Displaying 1-10 of 20 results found.
0, 1, 9, 73, 585, 4681, 37449, 299593, 2396745, 19173961, 153391689, 1227133513, 9817068105, 78536544841, 628292358729, 5026338869833, 40210710958665, 321685687669321, 2573485501354569, 20587884010836553, 164703072086692425
COMMENTS
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=8, (i>1), A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n >= 1, a(n) = det(A). - Milan Janjic, Feb 21 2010
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=9, (i>1), A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n >= 1, a(n-1) = (-1)^n*charpoly(A,1). - Milan Janjic, Feb 21 2010
This is the sequence A(0,1;7,8;2) = A(0,1;8,0;1) of the family of sequences [a,b:c,d:k] considered by G. Detlefs, and treated as A(a,b;c,d;k) in the W. Lang link given below. - Wolfdieter Lang, Oct 18 2010
a(n) is the total number of squares the carpetmaker has removed after the n-th step of a Sierpiński carpet production. - Ivan N. Ianakiev, Oct 22 2013
For n >= 1, a(n) is the total number of holes in a box fractal (start with 8 boxes, 1 hole) after n iterations. See illustration in link. - Kival Ngaokrajang, Jan 27 2015
Except for 0, 1 and 73, all the terms are composite because a(n) = ((2^n - 1) * (4^n + 2^n + 1))/7.
For n >= 3, all terms are Brazilian repunits numbers in base 8, and so belong to A125134.
a(3) = 73 is the only Brazilian prime in base 8, and so it belongs to A085104 and A285017. (End)
LINKS
Eric Weisstein's World of Mathematics, Repunit.
FORMULA
a(0) = 0, a(n) = 8*a(n-1) + 1 for n>0.
G.f.: x/((1-8x)*(1-x)). (End)
a(n) = 7*a(n-1) + 8*a(n-2) + 2, a(0)=0, a(1)=1.
a(n) = 8*a(n-1) + a(n-2) - 8*a(n-3) = 9*a(n-1) - 8*a(n-2), a(0)=0, a(1)=1, a(2)=9. Observation by Gary Detlefs. See the W. Lang comment and link. (End)
a(n) = Sum_{k=0..n-1} 8^k. - Doug Bell, May 26 2017
EXAMPLE
Octal.............decimal
0....................0
1....................1
11...................9
111.................73
1111...............585
11111.............4681
111111...........37449
1111111.........299593
11111111.......2396745
111111111.....19173961
1111111111...153391689
etc. ...............etc. (End)
a(4) = (8^4 - 1)/7 = 585 = 1111_8 = (2^4 - 1) * (4^4 + 2^4 + 1)/7 = 15 * 273/7 = 15 * 39. - Bernard Schott, May 01 2017
MAPLE
a:=n->sum(8^(n-j), j=1..n): seq(a(n), n=0..20); # Zerinvary Lajos, Jan 04 2007
MATHEMATICA
Table[(8^n-1)/7, {n, 0, m}]
LinearRecurrence[{9, -8}, {0, 1}, 30] (* Harvey P. Dale, Feb 12 2015 *)
PROG
(Sage) [lucas_number1(n, 9, 8) for n in range(0, 21)] # Zerinvary Lajos, Apr 23 2009
(Sage) [gaussian_binomial(n, 1, 8) for n in range(0, 21)] # Zerinvary Lajos, May 28 2009
(Maxima) A023001(n):=floor((8^n-1)/7)$
(GAP)
Primes of the form 1 + n + n^2 + n^3 + ... + n^k, n > 1, k > 1.
+10
66
7, 13, 31, 43, 73, 127, 157, 211, 241, 307, 421, 463, 601, 757, 1093, 1123, 1483, 1723, 2551, 2801, 2971, 3307, 3541, 3907, 4423, 4831, 5113, 5701, 6007, 6163, 6481, 8011, 8191, 9901, 10303, 11131, 12211, 12433, 13807, 14281, 17293, 19183, 19531, 20023
COMMENTS
Also known as Brazilian primes. The primes that are not Brazilian primes are in A220627.
The number of terms k+1 is always an odd prime, but this is not enough to guarantee a prime, for example 111 = 1 + 10 + 100 = 3*37.
The inverses of the Brazilian primes form a convergent series; the sum is slightly larger than 0.33 (see Theorem 4 of Quadrature article in the Links). (End)
It is not known whether there are infinitely many Brazilian primes. See A002383. - Bernard Schott, Jan 11 2013
Primes of the form (n^p - 1)/(n - 1), where p is odd prime and n > 1. - Thomas Ordowski, Apr 25 2013
Number of terms less than 10^n: 1, 5, 14, 34, 83, 205, 542, 1445, 3880, 10831, 30699, 88285, ..., . - Robert G. Wilson v, Mar 31 2014
Brazilian primes fall into two classes:
1) when n is prime, we get sequence A023195 except 3 which is not Brazilian,
2) when n is composite, we get sequence A285017. (End)
The conjecture proposed in Quadrature "No Sophie Germain prime is Brazilian (prime)" (see link Bernard Schott, Quadrature, Conjecture 1, page 36) is false. Thanks to Giovanni Resta, who found that a(856) = 28792661 = 1 + 73 + 73^2 + 73^3 + 73^4 = (11111)_73 is the 141385th Sophie Germain prime. - Bernard Schott, Mar 08 2019
REFERENCES
Daniel Lignon, Dictionnaire de (presque) tous les nombres entiers, Ellipses, Paris, 2012, page 174.
LINKS
Bernard Schott, Les nombres brésiliens, Quadrature, no. 76, avril-juin 2010, pages 30-38; included here with permission from the editors of Quadrature.
EXAMPLE
13 is a term since it is prime and 13 = 1 + 3 + 3^2 = 111_3.
31 is a term since it is prime and 31 = 1 + 2 + 2^2 + 2^3 + 2^4 = 11111_2.
The sequence represented as a sparse matrix with the k-th column indexed by A006093(k+1), primes minus 1, and row n by A000027(n+1). Traversing the matrix by counterdiagonals produces a non-monotone ordering.
2 4 6 10 12 16
2 7 31 127 - 8191 131071
3 13 - 1093 - 797161 -
4 - - - - - -
5 31 - 19531 12207031 305175781 -
6 43 - 55987 - - -
7 - 2801 - - 16148168401 -
8 73 - - - - -
9 - - - - - -
10 - - - - - -
11 - - - - - 50544702849929377
12 157 22621 - - - -
13 - 30941 5229043 - - -
14 211 - 8108731 - - -
15 241 - - - - -
16 - - - - - -
17 307 88741 25646167 2141993519227 - -
18 - - - - - -
19 - - - - - -
20 421 - - 10778947368421 - 689852631578947368421
21 463 - - 17513875027111 - 1502097124754084594737
22 - 245411 - - - -
23 - 292561 - - - -
24 601 346201 - - - -
Except for the initial values in the respective sequences the rows and columns as labeled in the matrix are:
(End)
MATHEMATICA
max = 140; maxdata = (1 - max^3)/(1 - max); a = {}; Do[i = 1; While[i = i + 2; cc = (1 - m^i)/(1 - m); cc <= maxdata, If[PrimeQ[cc], a = Append[a, cc]]], {m, 2, max}]; Union[a] (* Lei Zhou, Feb 08 2012 *)
f[n_] := Block[{i = 1, d, p = Prime@ n}, d = Rest@ Divisors[p - 1]; While[ id = IntegerDigits[p, d[[i]]]; id != Reverse@ id || Union@ id != {1}, i++]; d[[i]]]; Select[ Range[2, 60], 1 + f@# != Prime@# &] (* Robert G. Wilson v, Mar 31 2014 *)
PROG
(PARI) list(lim)=my(v=List(), t, k); for(n=2, sqrt(lim), t=1+n; k=1; while((t+=n^k++)<=lim, if(isprime(t), listput(v, t)))); vecsort(Vec(v), , 8) \\ Charles R Greathouse IV, Jan 08 2013
(PARI) A085104_vec(N, L=List())=forprime(K=3, logint(N+1, 2), for(n=2, sqrtnint(N-1, K-1), isprime((n^K-1)\(n-1))&&listput(L, (n^K-1)\(n-1)))); Set(L) \\ M. F. Hasler, Jun 26 2018
(Haskell)
a085104 n = a085104_list !! (n-1)
a085104_list = filter ((> 1) . a088323) a000040_list
CROSSREFS
Cf. A003424 (n restricted to prime powers).
AUTHOR
Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jul 03 2003
Prime numbers that are the sum of the divisors of some n.
+10
29
3, 7, 13, 31, 127, 307, 1093, 1723, 2801, 3541, 5113, 8011, 8191, 10303, 17293, 19531, 28057, 30103, 30941, 86143, 88741, 131071, 147073, 292561, 459007, 492103, 524287, 552793, 579883, 598303, 684757, 704761, 732541, 735307, 797161, 830833, 1191373
COMMENTS
If n > 2 and sigma(n) is prime, then n must be an even power of a prime number. For example, 1093 = sigma(3^6). - T. D. Noe, Jan 20 2004
All primes of the form 2^n-1 (Mersenne primes) are in the sequence because if n is a natural number then sigma(2^(n-1)) = 2^n-1. So A000668 is a subsequence of this sequence. If sigma(n) is prime then n is of the form p^(q-1) where both p & q are prime (the proof is easy). - Farideh Firoozbakht, May 28 2005
Primes of the form 1 + p + p^2 + ... + p^k where p is prime.
Except for 3, these primes are particular Brazilian primes belonging to A085104. These prime numbers are also Brazilian primes of the form (p^x - 1)/(p^y - 1), p prime, belonging to A003424, with here x is prime, and y = 1. [See section V.4 of Quadrature article in Links.] - Bernard Schott, Dec 25 2012
Others subsequences of this sequence:
A053183 for 111_p = p^2 + p + 1 when p is prime.
A190527 for 11111_p = p^4 + p^3 + p^2 + p + 1 when p is prime.
A194257 for 1111111_p = p^6 + p^5 + p^4 + p^3 + p^2 + p + 1 when p is prime. (End)
LINKS
Bernard Schott, Les nombres brésiliens, Quadrature, no. 76, avril-juin 2010, pages 30-38; included here with permission from the editors of Quadrature.
EXAMPLE
307 = 1 + 17 + 17^2; 307 and 17 are primes.
MATHEMATICA
t={3}; lim=10^9; n=1; While[p=Prime[n]; k=2; s=1+p+p^2; s<lim, While[s<lim, If[PrimeQ[s], AppendTo[t, s]]; k=k+2; s=s+(1+p)p^(k-1)]; n++]; t=Union[t]
Select[DivisorSigma[1, Range[2 10^6]], PrimeQ]//Union (* Harvey P. Dale, Jun 18 2022 *)
PROG
(PARI) upto(lim)=my(v=List([3]), t); forprime(p=2, solve(x=1, lim^(1/4), x^4+x^3+x^2+x+1-lim), forprime(e=5, 1+log(lim)\log(p), if(isprime(t=sigma(p^(e-1))) && t<=lim, listput(v, t)))); forprime(p=2, solve(x=1, lim^(1/2), x^2+x+1-lim), if(isprime(t=p^2+p+1), listput(v, t))); vecsort(Vec(v), , 8) \\ Charles R Greathouse IV, Dec 20 2011
(Python)
from sympy import isprime, divisor_sigma
A023195_list = sorted(set([3]+[n for n in (divisor_sigma(d**2) for d in range(1, 10**4)) if isprime(n)])) # Chai Wah Wu, Jul 23 2016
Repunits in different bases: table by antidiagonals of numbers written in base k as a string of n 1's.
+10
19
1, 1, 2, 1, 3, 3, 1, 4, 7, 4, 1, 5, 13, 15, 5, 1, 6, 21, 40, 31, 6, 1, 7, 31, 85, 121, 63, 7, 1, 8, 43, 156, 341, 364, 127, 8, 1, 9, 57, 259, 781, 1365, 1093, 255, 9, 1, 10, 73, 400, 1555, 3906, 5461, 3280, 511, 10, 1, 11, 91, 585, 2801, 9331, 19531, 21845, 9841, 1023, 11
FORMULA
T(n, k) = (k^n-1)/(k-1) [with T(n, 1) = n] = T(n-1, k)+k^(n-1) = (k+1)*T(n-1, k)-k*T(n-2, k) [with T(0, k) = 0 and T(1, k) = 1].
T(n,k) = 1 + k * T(n-1,k) for k > 0 and n > 1.
Sum_{m=2..n} T(m-1,k)/Product_{i=2..m} T(i,k) = (1 - 1/Product_{i=2..n} T(i,k))/k for k > 0 and n > 1.
Sum_{n > 1} T(n-1,k)/Product_{i=2..n} T(i,k) = 1/k for k > 0.
Sum_{i=1..n} k^(i-1) / (T(i,k) * T(i+1,k)) = T(n,k) / T(n+1,k) for k > 0 and n > 0. (End)
EXAMPLE
T(3,5)=31 because 111 base 5 represents 25+5+1=31.
1 1 1 1 1 1 1
2 3 4 5 6 7 8
3 7 13 21 31 43 57
4 15 40 85 156 259 400
5 31 121 341 781 1555 2801
6 63 364 1365 3906 9331 19608
7 127 1093 5461 19531 55987 137257
Starting with the second column, the q-th column list the numbers that are written as 11...1 in base q. - John Keith, Apr 12 2021
MATHEMATICA
Table[FromDigits[ConstantArray[1, #], k] &[n - k + 1], {n, 11}, {k, n, 1, -1}] // Flatten (* or *)
Table[If[k == 1, n, (k^# - 1)/(k - 1) &[n - k + 1]], {n, 11}, {k, n, 1, -1}] // Flatten (* Michael De Vlieger, Dec 11 2016 *)
CROSSREFS
Rows include A000012, A000027, A002061, A053698, A053699, A053700. Columns (see recurrence) include A000027, A000225, A003462, A002450, A003463, A003464, A023000, A023001, A002275, A016123, A016125. Diagonals include A023037, A031973. Numbers in the table (apart from the first column and first two rows) are ordered in A053696.
a(n) = (n^(n-1) - 1)/(n-1) for n>1, a(1) = 0.
+10
16
0, 1, 4, 21, 156, 1555, 19608, 299593, 5380840, 111111111, 2593742460, 67546215517, 1941507093540, 61054982558011, 2085209001813616, 76861433640456465, 3041324492229179280, 128583032925805678351, 5784852794328402307380, 275941052631578947368421
COMMENTS
(n-1)-digit repunits in base n written in decimal.
EXAMPLE
a(10)=111111111; i.e., just nine 1's (converted from base 10 to decimal).
MATHEMATICA
Join[{0}, Array[(#^(#-1)-1)/(#-1)&, 20, 2]] (* Harvey P. Dale, Jun 04 2013 *)
PROG
(PARI) a(n) = if (n==1, 0, (n^(n - 1) - 1)/(n - 1)); \\ Harry J. Smith, Jul 01 2009
(Magma) [0] cat [ (n^(n-1) -1)/(n-1) : n in [2..25]]; // G. C. Greubel, Aug 15 2022
(SageMath) [0]+[(n^(n-1) -1)/(n-1) for n in (2..25)] # G. C. Greubel, Aug 15 2022
Numbers that are repdigits with length > 2 in some base.
+10
15
0, 7, 13, 15, 21, 26, 31, 40, 42, 43, 57, 62, 63, 73, 80, 85, 86, 91, 93, 111, 114, 121, 124, 127, 129, 133, 146, 156, 157, 170, 171, 172, 182, 183, 211, 215, 219, 222, 228, 241, 242, 255, 259, 266, 273, 285, 292, 307, 312, 314, 333, 341, 342, 343, 364, 365, 366
COMMENTS
Definition requires "length > 2" because all numbers n > 2 are trivially represented as "11" in base n-1.
EXAMPLE
26 is a term because 26_10 = 222_3.
PROG
(PARI) digits(n, b) = if(n<b, [n], concat(digits(floor(n/b), b), n%b))
is_repdigit(d) = {local(a, r); r=1; a=d[1]; for(i=2, matsize(d)[2], if(a!=d[i], r=0)); r}
for(n=1, 1200, b=2; while(n>=b^2+b+1, d=digits(n, b); if(is_repdigit(d), print(n, " = ", d, " base ", b)); b++)) \\ Michael B. Porter
CROSSREFS
Cf. A167783 (Numbers that are repdigits with length > 2 in more than one base).
Cf. A053696 (Numbers which are repunits in some base).
Cf. A158235 (Numbers n whose square can be represented as a repdigit number in some base < n).
Numbers that are repdigits with length > 2 in more than one base.
+10
13
31, 63, 255, 273, 364, 511, 546, 728, 777, 931, 1023, 1365, 1464, 2730, 3280, 3549, 3783, 3906, 4095, 4557, 6560, 7566, 7812, 8191, 9114, 9331, 9841, 10507, 11349, 11718, 13671, 14043, 14763, 15132, 15624, 16383, 18291, 18662, 18915, 19608, 19682, 21845, 22351, 22698
COMMENTS
Definition requires "length > 2" because all numbers n > 2 are trivially represented as "11" in base n-1.
0 = 00 = 000 = 0000 = 00000 = 000000 = 0000000 = 00000000 = ... in any positional number representation (includes fixed base radix b > 1, mixed base radix with each b_i > 1, i >= 0, such as factorial and primorial based radix...)
The sequence definition should be read as:
Nonnegative integers that are repdigits with length > 2 in more than one fixed base radix b > 1.
Considering all fixed and mixed base radix would include many more nonnegative integers (but not the integers 1 to 6) which are repdigits with length > 2 in more than one radix. (End)
In this sequence data, the first number which is repdigit, with length > 2, in more than two bases is the twelfth Mersenne number 4095 with four Brazilian representations: M_12 = 4095 = 111111111111_2 = 333333_4 = 7777_8 = (15 15 15)_16.
The Mersenne number M_15 is the first number which is repdigit in exactly three bases with M_15 = 32767 = 111111111111111_2 = 77777_8 = (31 31 31)_32.
Only two numbers are repunits in more than one base: the Mersenne primes 31 and 8191 (Examples and A119598).
Some numbers are once repunit and once multiple of a Brazilian prime such that Mersenne number M_9 = 511 = 7 * 73 = 111111111_2 = 7 * 111_8 = 777_8.
Some numbers are once repunit and once multiple of a composite repunit such that Mersenne number M_6 = 63 = 3 * 21 = 111111_2 = 3 * 111_4 = 333_4.
Some numbers are repdigits in two different bases: 546 = 666_9 = 222_16. (End)
EXAMPLE
31 is in the list because 31 = 11111_2 = 111_5;
8191 = 1111111111111_2 = 111_90;
10507 = {19 19 19}_23 = 111_102.
MATHEMATICA
Select[Range[550], Function[n, 1 < Count[Range[2, n - 1], _?(And[Length@ DeleteCases[#, 0] == 1, Union[#][[2]] > 2] &@ DigitCount[n, #] &)]]] (* Michael De Vlieger, Aug 09 2017 *)
PROG
(PARI) isok(n)=my(nb = 0); for (b=2, n-1, d = digits(n, b); if ((#d > 2) && (#Set(d) == 1), nb++); if (nb > 1, return (1)); ); return (0); \\ Michel Marcus, Aug 08 2017
CROSSREFS
Cf. A167782 (numbers that are repdigits with length > 2 in some base).
Cf. A053696 (numbers which are repunits in some base).
Cf. A158235 (numbers n whose square is a repdigit in some base < n).
Cf. A290869 (Numbers that are repdigits with length > 2 in more than two bases).
Numbers that are repunits in four or more bases.
+10
10
COMMENTS
Except for first term, numbers which can be represented as a string of three or more 1's in a base >=2 in more than one way; subset of A053696.
No more terms less than 2^44 = 17592186044416. - Ray Chandler, Jun 08 2006
Let the 4-tuple (a,b,m,n) be a solution to the exponential Diophantine equation (a^m-1)/(a-1)=(b^n-1)/(b-1) with a>1, b>a, m>2 and n>2. Then (a^m-1)/(a-1) is in this sequence. The terms 31 and 8191 correspond to the solutions (2,5,5,3) and (2,90,13,3), respectively. No other solutions with n=3 and b<10^5. The Mathematica code finds repunits in increasing order and prints solutions. - T. D. Noe, Jun 07 2006
Following the Goormaghtigh conjecture (Links), 31 and 8191 which are both Mersenne numbers, are the only primes which are Brazilian in two different bases. - Bernard Schott, Jun 25 2013
LINKS
Eric Weisstein's World of Mathematics, Repunit
EXAMPLE
a(1)=1 is a repunit in every base. a(2)=31 is a repunit in bases 1, 2, 5 and 30. a(3)=8191 is a repunit in bases 1, 2, 90 and 8190.
31 and 8191 are Brazilian numbers in two different bases:
31 = 11111_2 = 111_5,
8191 = 1111111111111_2 = 111_90.
MATHEMATICA
fQ[n_] := Block[{d = Rest@Divisors[n - 1]}, Length@d > 2 && Length@Select[IntegerDigits[n, d], Union@# == {1} &] > 2]; Do[ If[ fQ@n, Print@n], {n, 10^8/3}] (* Robert G. Wilson v *)
nn=1000; pow=Table[3, {nn}]; t=Table[If[n==1, Infinity, (n^3-1)/(n-1)], {n, nn}]; While[pos=Flatten[Position[t, Min[t]]]; !MemberQ[pos, nn], If[Length[pos]>1, Print[{pos, pow[[pos]], t[[pos[[1]]]]}]]; Do[n=pos[[i]]; pow[[n]]++; t[[n]]=(n^pow[[n]]-1)/(n-1), {i, Length[pos]}]] (* T. D. Noe, Jun 07 2006 *)
PROG
(Python)
def isrep(n, b):
while n >= b:
n, r = divmod(n, b)
if r != 1: return False
return n == 1
def agen():
yield 1
n = 2
while True:
reps = 2 # n is a repunit in bases 1 and n-1
for b in range(2, n-1):
if isrep(n, b): reps += 1
if reps == 4: yield n; break
n += 1
CROSSREFS
Cf. A053696 (numbers of the form (b^k-1)/(b-1)).
Cf. A145461: bases 5 and 90 are 2 exceptions (Goormaghtigh's conjecture).
Primes of the form 1 + n + n^2 + n^3 + ... + n^k, n > 1, k > 1 where n is not prime.
+10
7
43, 73, 157, 211, 241, 421, 463, 601, 757, 1123, 1483, 2551, 2971, 3307, 3907, 4423, 4831, 5701, 6007, 6163, 6481, 8191, 9901, 11131, 12211, 12433, 13807, 14281, 19183, 20023, 20593, 21757, 22621, 22651, 23563, 24181, 26083, 26407, 27061, 28393, 31153, 35533
COMMENTS
These numbers are Brazilian primes belonging to A085104.
Brazilian primes with n prime are A023195, except 3 which is not Brazilian.
k + 1 is necessarily prime, but that's not sufficient: 1 + 10 + 100 = 111.
Most of these terms come from A185632 which are prime numbers 111_n with n no prime, the first other term is 22621 = 11111_12, the next one is 245411 = 11111_22.
Number of terms < 10^k: 0, 2, 9, 23, 64, 171, 477, 1310, 3573, 10098, ..., . - Robert G. Wilson v, Apr 15 2017
LINKS
Bernard Schott, Les nombres brésiliens, Reprinted from Quadrature, no. 76, April-June 2010, pages 30-38, included here with permission from the editors of Quadrature.
EXAMPLE
157 = 12^2 + 12 + 1 = 111_12 is prime and 12 is composite.
MAPLE
N:= 40000: # to get all terms <= N
res:= NULL:
for k from 2 to ilog2(N) do if isprime(k) then
for n from 2 do
p:= (n^(k+1)-1)/(n-1);
if p > N then break fi;
if isprime(p) and not isprime(n) then res:= res, p fi
od fi od:
res:= {res}:
MATHEMATICA
mx = 36000; g[n_] := Select[Drop[Accumulate@Table[n^ex, {ex, 0, Log[n, mx]}], 2], PrimeQ]; k = 1; lst = {}; While[k < Sqrt@mx, If[CompositeQ@k, AppendTo[lst, g@k]; lst = Sort@Flatten@lst]; k++]; lst (* Robert G. Wilson v, Apr 15 2017 *)
PROG
(PARI) isok(n) = {if (isprime(n), forcomposite(b=2, n, d = digits(n, b); if ((#d > 2) && (vecmin(d) == 1) && (vecmax(d)== 1), return(1)); ); ); return(0); } \\ Michel Marcus, Apr 09 2017
(PARI) A285017_vec(n)={my(h=vector(n, i, 1), y, c, z=4, L:list); L=List(); forprime(x=3, , forcomposite(m=z, x-1, y=digits(x, m); if((y==h[1..#y])&&2<#y, listput(L, x); z=m; if(c++==n, return(Vec(L))))))} \\ R. J. Cano, Apr 18 2017
Number of numbers b>1 such that n is a repunit in base b representation.
+10
5
0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
COMMENTS
is a(n) < 4 ?;
n>2: a(n) > 0 as n = (n-1)^1 + (n-1)^0.
LINKS
Eric Weisstein's World of Mathematics, Repunit
EXAMPLE
a(31)=3: 31 = 2^4+2^3+2^2+2^1+2^0 = 5^2+5^1+5^0 = 30^1+30^0.
PROG
(Haskell)
a088323 n = sum $ map (f n) [2 .. n-1] where
f x b = if x == 0 then 1 else if d /= 1 then 0 else f x' b
where (x', d) = divMod x b
Search completed in 0.097 seconds
|