cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 20 results. Next

A023001 a(n) = (8^n - 1)/7.

Original entry on oeis.org

0, 1, 9, 73, 585, 4681, 37449, 299593, 2396745, 19173961, 153391689, 1227133513, 9817068105, 78536544841, 628292358729, 5026338869833, 40210710958665, 321685687669321, 2573485501354569, 20587884010836553, 164703072086692425
Offset: 0

Views

Author

Keywords

Comments

Gives the (zero-based) positions of odd terms in A007556 (numbers n such that A007556(a(n)) mod 2 = 1). - Farideh Firoozbakht, Jun 13 2003
{1, 9, 73, 585, 4681, ...} is the binomial transform of A003950. - Philippe Deléham, Jul 22 2005
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
From Bernard Schott, May 01 2017: (Start)
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)

Examples

			From _Zerinvary Lajos_, Jan 14 2007: (Start)
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
		

Crossrefs

Programs

Formula

Also sum of cubes of divisors of 2^(n-1): a(n) = A001158(A000079(n-1)). - Labos Elemer, Apr 10 2003 and Farideh Firoozbakht, Jun 13 2003
a(n) = A033138(3n-2). - Alexandre Wajnberg, May 31 2005
From Philippe Deléham, Oct 12 2006: (Start)
a(0) = 0, a(n) = 8*a(n-1) + 1 for n>0.
G.f.: x/((1-8x)*(1-x)). (End)
From Wolfdieter Lang, Oct 18 2010: (Start)
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
E.g.f.: exp(x)*(exp(7*x) - 1)/7. - Stefano Spezia, Mar 11 2023

A085104 Primes of the form 1 + n + n^2 + n^3 + ... + n^k, n > 1, k > 1.

Original entry on oeis.org

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
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jul 03 2003

Keywords

Comments

Primes that are base-b repunits with three or more digits for at least one b >= 2: Primes in A053696. Subsequence of A000668 U A076481 U A086122 U A165210 U A102170 U A004022 U ... (for each possible b). - Rick L. Shepherd, Sep 07 2009
From Bernard Schott, Dec 18 2012: (Start)
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
From Bernard Schott, Apr 08 2017: (Start)
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

Examples

			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.
From _Hartmut F. W. Hoft_, May 08 2017: (Start)
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:
column  2:  A002383            row 2:  A000668
column  4:  A088548            row 3:  A076481
column  6:  A088550            row 4:  -
column 10:  A162861            row 5:  A086122.
(End)
		

References

  • Daniel Lignon, Dictionnaire de (presque) tous les nombres entiers, Ellipses, Paris, 2012, page 174.

Crossrefs

Cf. A189891 (complement), A125134 (Brazilian numbers), A220627 (Primes that are non-Brazilian).
Cf. A003424 (n restricted to prime powers).
Equals A023195 \3 Union A285017 with empty intersection.
Primes of the form (b^k-1)/(b-1) for b=2: A000668, b=3: A076481, b=5: A086122, b=6: A165210, b=7: A102170, b=10: A004022.
Primes of the form (b^k-1)/(b-1) for k=3: A002383, k=5: A088548, k=7: A088550, k=11: A162861.

Programs

  • Haskell
    a085104 n = a085104_list !! (n-1)
    a085104_list = filter ((> 1) . a088323) a000040_list
    -- Reinhard Zumkeller, Jan 22 2014
  • 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 *)
  • 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
    

Formula

A010051(a(n)) * A088323(a(n)) > 1. - Reinhard Zumkeller, Jan 22 2014

Extensions

More terms from David Wasserman, Jan 26 2005

A023195 Prime numbers that are the sum of the divisors of some n.

Original entry on oeis.org

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
Offset: 1

Views

Author

Keywords

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.
If n = sigma(p^k) is in the sequence, then k+1 is prime. - Franklin T. Adams-Watters, Dec 19 2011
Primes that are a repunit in a prime base. - Franklin T. Adams-Watters, Dec 19 2011.
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
From Bernard Schott, Dec 25 2012: (Start)
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)
Subsequence of primes from A002191. - Michel Marcus, Jun 10 2014

Examples

			307 = 1 + 17 + 17^2; 307 and 17 are primes.
		

Crossrefs

Intersection of A002191 and A000040.
Cf. A000203, A000668, A023194 (the n that produce these primes), A053696, A085104, A003424, A053183, A190527, A194257.

Programs

  • Mathematica
    t={3}; lim=10^9; n=1; While[p=Prime[n]; k=2; s=1+p+p^2; sHarvey P. Dale, Jun 18 2022 *)
  • 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

A055129 Repunits in different bases: table by antidiagonals of numbers written in base k as a string of n 1's.

Original entry on oeis.org

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
Offset: 1

Views

Author

Henry Bottomley, Jun 14 2000

Keywords

Examples

			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
		

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.

Programs

  • Maple
    A055129 := proc(n,k)
        add(k^j,j=0..n-1) ;
    end proc: # R. J. Mathar, Dec 09 2015
  • 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 *)

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].
From Werner Schulte, Aug 29 2021 and Sep 18 2021: (Start)
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)

A060072 a(n) = (n^(n-1) - 1)/(n-1) for n>1, a(1) = 0.

Original entry on oeis.org

0, 1, 4, 21, 156, 1555, 19608, 299593, 5380840, 111111111, 2593742460, 67546215517, 1941507093540, 61054982558011, 2085209001813616, 76861433640456465, 3041324492229179280, 128583032925805678351, 5784852794328402307380, 275941052631578947368421
Offset: 1

Views

Author

Henry Bottomley, Feb 21 2001

Keywords

Comments

(n-1)-digit repunits in base n written in decimal.

Examples

			a(10)=111111111; i.e., just nine 1's (converted from base 10 to decimal).
		

Crossrefs

Cf. other sequences of generalized repunits, such as A053696, A055129, A031973, A125598, A173468, A023037, A119598, A085104, and A162861.

Programs

  • Magma
    [0] cat [ (n^(n-1) -1)/(n-1) : n in [2..25]]; // G. C. Greubel, Aug 15 2022
    
  • Mathematica
    Join[{0},Array[(#^(#-1)-1)/(#-1)&,20,2]] (* Harvey P. Dale, Jun 04 2013 *)
  • PARI
    a(n) = if (n==1, 0, (n^(n - 1) - 1)/(n - 1)); \\ Harry J. Smith, Jul 01 2009
    
  • SageMath
    [0]+[(n^(n-1) -1)/(n-1) for n in (2..25)] # G. C. Greubel, Aug 15 2022

Formula

a(n+1) = Sum_{k=1..n} n^(k-1)*C(n, k). - Olivier Gérard, Jun 26 2001 [Corrected by Mathew Englander, Dec 15 2020]
a(n) = Sum_{j=2..n} n^(n-j). - Zerinvary Lajos, Sep 11 2006
a(n+1) = A125118(n,n). - Reinhard Zumkeller, Nov 21 2006
a(n) = Integral_{x=1/n..1} 1/x^n dx. - Francesco Daddi, Aug 01 2011
a(n) = A037205(n-1)/(n-1) = A060073(n)*(n-1) = A023037(n) - A000169(n).
a(n) = [x^n] x^2/((1 - x)*(1 - n*x)). - Ilya Gutkovskiy, Oct 04 2017
a(n) = 1 + A228275(n, n-2) for n >= 2. - Mathew Englander, Dec 14 2020

Extensions

Name edited by Michel Marcus, Dec 14 2020

A167782 Numbers that are repdigits with length > 2 in some base.

Original entry on oeis.org

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
Offset: 1

Views

Author

Andrew Weimholt, Nov 12 2009

Keywords

Comments

Definition requires "length > 2" because all numbers n > 2 are trivially represented as "11" in base n-1.
0 included at the suggestion of Franklin T. Adams-Watters (and others) as 0 = 000 in any base.

Examples

			26 is a term because 26_10 = 222_3.
		

Crossrefs

Cf. A010785 (Repdigits (base 10)).
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).

Programs

  • PARI
    /* In PARI versions < 2.6, define: digits(n,b) = if(n=b^2+b+1,d=digits(n,b);if(is_repdigit(d),print(n," = ",d," base ",b));b++)) \\ Michael B. Porter

A167783 Numbers that are repdigits with length > 2 in more than one base.

Original entry on oeis.org

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
Offset: 1

Views

Author

Andrew Weimholt, Nov 12 2009

Keywords

Comments

Definition requires "length > 2" because all numbers n > 2 are trivially represented as "11" in base n-1.
From Daniel Forgues, Nov 13 2009: (Start)
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)
From Bernard Schott, Aug 08 2017: (Start)
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)

Examples

			31 is in the list because 31 = 11111_2 = 111_5;
8191 = 1111111111111_2 = 111_90;
10507 = {19 19 19}_23 = 111_102.
		

Crossrefs

Cf. A167782 (numbers that are repdigits with length > 2 in some base).
Cf. A010785 (repdigits (base 10)).
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).

Programs

Extensions

a(41)-a(44) from Bernard Schott, Aug 08 2017

A119598 Numbers that are repunits in four or more bases.

Original entry on oeis.org

1, 31, 8191
Offset: 1

Views

Author

Sergio Pimentel, Jun 01 2006

Keywords

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

Examples

			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.
		

Crossrefs

Cf. A053696 (numbers of the form (b^k-1)/(b-1)).
Cf. A145461: bases 5 and 90 are 2 exceptions (Goormaghtigh's conjecture).
Cf. A085104 (Brazilian primes).

Programs

  • 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 *)
  • 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
    for m in agen(): print(m) # Michael S. Branicky, Jan 31 2021

Extensions

Edited by Ray Chandler, Jun 08 2006

A285017 Primes of the form 1 + n + n^2 + n^3 + ... + n^k, n > 1, k > 1 where n is not prime.

Original entry on oeis.org

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
Offset: 1

Views

Author

Bernard Schott, Apr 08 2017

Keywords

Comments

These numbers are Brazilian primes belonging to A085104.
Brazilian primes with n prime are A023195, except 3 which is not Brazilian.
A085104 = This sequence Union { A023195 \ number 3 }.
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

Examples

			157 = 12^2 + 12 + 1 = 111_12 is prime and 12 is composite.
		

Crossrefs

Programs

  • 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}:
    sort(convert(res,list)); # Robert Israel, Apr 14 2017
  • 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 *)
  • 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

A088323 Number of numbers b>1 such that n is a repunit in base b representation.

Original entry on oeis.org

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
Offset: 2

Views

Author

Reinhard Zumkeller, Nov 06 2003

Keywords

Comments

is a(n) < 4 ?;
n>2: a(n) > 0 as n = (n-1)^1 + (n-1)^0.
a(A119598(n)) > 3; a(A053696(n)) > 2; a(A085104(n)) > 2. - Reinhard Zumkeller, Jan 22 2014

Examples

			a(31)=3: 31 = 2^4+2^3+2^2+2^1+2^0 = 5^2+5^1+5^0 = 30^1+30^0.
		

Crossrefs

Programs

  • 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
    -- Reinhard Zumkeller, Jan 22 2014

Extensions

Example corrected by Reinhard Zumkeller, Jan 22 2014
Showing 1-10 of 20 results. Next