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 11 results. Next

A054767 Period of the sequence of Bell numbers A000110 (mod n).

Original entry on oeis.org

1, 3, 13, 12, 781, 39, 137257, 24, 39, 2343, 28531167061, 156, 25239592216021, 411771, 10153, 48, 51702516367896047761, 39, 109912203092239643840221, 9372, 1784341, 85593501183, 949112181811268728834319677753, 312, 3905, 75718776648063, 117, 1647084
Offset: 1

Views

Author

Eric W. Weisstein, Feb 09 2002

Keywords

Comments

For p prime, a(p) divides (p^p-1)/(p-1) = A023037(p), with equality at least for p up to 19.
Wagstaff shows that N(p) = (p^p-1)/(p-1) is the period for all primes p < 102 and for primes p = 113, 163, 167 and 173. For p = 7547, N(p) is a probable prime, which means that this p may have the maximum possible period N(p) also. See A088790. - T. D. Noe, Dec 17 2008

Crossrefs

Cf. A000110, A023037, A214810. A146093-A146122 gives Bell numbers read mod 3 to mod 32.

Programs

  • Mathematica
    (* Warning: this program is just a verification of the existing data
     and should not be used to extend the sequence beyond a(28) *)
    BellMod[k_, m_] := Mod[Sum[Mod[StirlingS2[k, j], m], {j, 1, k}], m];
    BellMod[k_, 1] := BellB[k];
    period[nn_List] := Module[{lgmin=2, lgmax=5, nn1},
       lg=If[Length[nn]<=lgmax, lgmin, lgmax];
       nn1 = nn[[1;;lg]];
       km=Length[nn]-lg;
       Catch[Do[If[nn1==nn[[k;;k+lg-1]], Throw[k-1]];
       If[k==km, Throw[0]], {k, 2, km}]]];
    dd[n_] := SelectFirst[Table[{d, n/d},
         {d, Divisors[n][[2;;-2]]}], GCD@@#==1&];
    a[1]=1;
    a[p_?PrimeQ] := a[p] = (p^p-1)/(p-1);
    a[n_/;n>4 && dd[n]!={}] := With[{g = dd[n]}, LCM[a[g[[1]]], a[g[[2]]]]];
    a[n_/;MemberQ[FactorInteger[n][[All, 2]], 1]] := a[n]=
       With[{pp = Select[FactorInteger[n], #1[[2]] ==1 &][[All, 1]]},
          a[n/Times@@pp]*Times@@a/@pp];
    a[n_/;n>4 && GCD @@ FactorInteger[n][[All, 2]]>1] := a[n]=
       With[{g=GCD @@ FactorInteger[n][[All, 2]]}, n^(1/g)*a[n^(1-1/g)]];
    a[n_] := period[Table[BellMod[k, n], {k, 1, 28}]];
    Table[a[n], {n, 1, 28}] (* Jean-François Alcover, Jul 31 2012, updated May 06 2024 *)

Formula

If gcd(n,m) = 1, a(n*m) = lcm(a(n), a(m)). But the sequence is not in general multiplicative; e.g. a(2) = 3, a(9) = 39 and a(18) = 39. - Franklin T. Adams-Watters, Jun 06 2006
a(2^s) = 3*2^s for s >= 2 (Theorem 6.4 in the Lunnon article). For an odd prime p, if a(p) = (p^p-1)/(p-1) (which is conjectured to hold for all p), then a(p^s) = p^(s-1)*(p^p-1)/(p-1) (Theorem 6.2 in the Lunnon article). - Jianing Song, Jun 18 2025

Extensions

More information from Phil Carmody, Dec 22 2002
Extended by T. D. Noe, Dec 18 2008
a(26) corrected by Jean-François Alcover, Jul 31 2012
a(18) corrected by Charles R Greathouse IV, Jul 31 2012
a(27)-a(28) from Charles R Greathouse IV, Sep 07 2016

A023037 a(n) = n^0 + n^1 + ... + n^(n-1), or a(n) = (n^n-1)/(n-1) with a(0)=0; a(1)=1.

Original entry on oeis.org

0, 1, 3, 13, 85, 781, 9331, 137257, 2396745, 48427561, 1111111111, 28531167061, 810554586205, 25239592216021, 854769755812155, 31278135027204241, 1229782938247303441, 51702516367896047761, 2314494592664502210319, 109912203092239643840221
Offset: 0

Views

Author

Keywords

Comments

For prime n, a(n) is conjectured to be the period of Bell numbers (mod n). See A054767. - T. D. Noe, Oct 12 2007
For prime n, a(n) is a multiple of the period of Bell numbers mod n (and conjectured to be exactly the period, as mentioned above). - Charles R Greathouse IV, Jul 31 2012
For n >= 1, a(n) is the number whose base n representation is a string of n ones. For example, 11111 in base 5 is a(5) = 781. - Melvin Peralta, May 23 2016
For n > 0, n^(a(n)-1) == 1 (mod a(n)), so for n > 1, a(n) is a prime or a Fermat pseudoprime to base n. - Thomas Ordowski, Mar 15 2021

Examples

			a(3) = 3^0 + 3^1 + 3^2 = 1+3+9 = 13.
		

Crossrefs

Cf. A001039, A054767, A088790 (n such that a(n) is prime), A125118.

Programs

Formula

a(n) = A125118(n,n-1) for n>1. - Reinhard Zumkeller, Nov 21 2006
a(n) = [x^n] x/((1 - x)*(1 - n*x)). - Ilya Gutkovskiy, Oct 04 2017

Extensions

Entry improved by Tobias Nipkow (nipkow(AT)in.tum.de).

A070518 Value of n-th cyclotomic polynomial at n.

Original entry on oeis.org

0, 3, 13, 17, 781, 31, 137257, 4097, 532171, 9091, 28531167061, 20593, 25239592216021, 7027567, 2392743361, 4294967297, 51702516367896047761, 34006393, 109912203092239643840221, 25536159601, 7006306553612521, 25405143539623, 949112181811268728834319677753
Offset: 1

Views

Author

Labos Elemer, May 02 2002

Keywords

Comments

a(28341) is divisible by 283411^2. What is the next n such that a(n) is not squarefree? - Jianing Song, Nov 01 2024

Examples

			n=10: 10th cyclotomic polynomial is 1-x+x^2-x^3+x^4; at x=10 it gives a(10)=9091.
		

Crossrefs

Cf. A070519 (indices of prime terms), A088790 (prime indices of prime terms).

Programs

  • Maple
    a:= n-> numtheory[cyclotomic](n$2):
    seq(a(n), n=1..25);  # Alois P. Heinz, Jul 05 2024
  • Mathematica
    Table[Cyclotomic[w, w], {w, 1, 35}]
  • PARI
    a(n) = polcyclo(n, n) \\ Michel Marcus, Apr 02 2016

A110932 Numbers k such that 2*k^k + 1 is prime.

Original entry on oeis.org

0, 1, 12, 18, 251, 82992
Offset: 0

Views

Author

Ray G. Opao, Sep 25 2005

Keywords

Comments

As a "list of numbers such that ...", the sequence should have offset 1, but to preserve the validity of formulas referring to this sequence, the offset was set to 0 when the initial value a(0)=0 was added. - M. F. Hasler, Sep 02 2012

Crossrefs

Cf. A110931, A121270 (= primes in A014566), A088790, A160360, A160600.
The primes 2n^n+1, for k<4, n=a(k)<251, are listed at A216148(k) = A216147(a(k)). - M. F. Hasler, Sep 02 2012

Programs

  • Mathematica
    Join[{0}, Select[Range[1000], PrimeQ[2*#^# + 1] &]] (* Robert Price, Mar 27 2019 *)
  • PARI
    is_A110932(n)=ispseudoprime(n^n*2+1) \\ M. F. Hasler, Sep 02 2012

Extensions

a(5) from Serge Batalov, Apr 08 2018

A070519 Numbers k such that Cyclotomic(k,k) (i.e., the value of k-th cyclotomic polynomial at k) is a prime number.

Original entry on oeis.org

2, 3, 4, 6, 10, 12, 14, 19, 31, 46, 74, 75, 98, 102, 126, 180, 236, 310, 368, 1770, 1858, 3512, 4878, 5730, 7547, 7990, 8636, 9378, 11262
Offset: 1

Views

Author

Labos Elemer, May 02 2002

Keywords

Comments

When n is prime, then the solutions are given in A088790.
No term of this sequence is congruent to 1 mod 4. In general, if k = s^2*t where t is squarefree and t == 1 (mod 4), then Cyclotomic(k,t*x^2) is the product of two polynomials. See the Wikipedia link below. - Jianing Song, Sep 25 2019
All terms <= 1858 have been proven with PARI's implementation of ECPP. All larger terms are BPSW PRPs. There are no further terms <= 30000. - Lucas A. Brown, Dec 28 2020

Crossrefs

Cf. A070518, A070520, A088790 ((k^k-1)/(k-1) is prime), A088817 (cyclotomic(2k,k) is prime), A088875 (cyclotomic(k,-k) is prime).

Programs

  • Mathematica
    Do[s=Cyclotomic[n, n]; If[PrimeQ[s], Print[n]], {n, 2, 256}]
  • PARI
    for(n=2,10^9,if(ispseudoprime(polcyclo(n,n)),print1(n,", "))); \\ Joerg Arndt, Jan 22 2015

Extensions

More terms from T. D. Noe, Oct 17 2003
a(29) from Charles R Greathouse IV, May 05 2011

A056826 Primes p such that (p^p + 1)/(p + 1) is a prime.

Original entry on oeis.org

3, 5, 17, 157
Offset: 1

Views

Author

Robert G. Wilson v, Aug 29 2000

Keywords

Comments

Note that (k^k+1)/(k+1) is prime only if k is prime, in which case it equals cyclotomic(2k,k), the 2k-th cyclotomic polynomial evaluated at x=k. This sequence is a subsequence of A088817. Are there only a finite number of these primes? - T. D. Noe, Oct 20 2003
(3^2 + 5^2)/2 = 17, (5^2 + 17^2)/2 = 157. - Thomas Ordowski, Jul 28 2013
Let b(0) = 1, b(1) = 3; b(n+1) = (b(n)^2 + b(n-1)^2)/2. Conjecture: if b(n) = p is prime, then (p^p+1)/(p+1) is prime. Note that b(1) = 3, b(2) = 5, b(3) = 17, b(4) = 157 and b(9) is also prime. - Thomas Ordowski, Jul 29 2013
Next term > 3000. - Seiichi Manyama, Mar 24 2018
No more terms through 6000. - Jon E. Schoenfield, Mar 25 2018
No more terms through 20000. - Michael S. Branicky, Jul 30 2024

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 157, p. 51, Ellipses, Paris 2008.
  • R. K. Guy, Unsolved Problems in Theory of Numbers, 1994 A3.

Crossrefs

Cf. A088790 ((n^n-1)/(n-1) is prime), A088817 (cyclotomic(2n, n) is prime).

Programs

  • Mathematica
    Do[ If[ PrimeQ[ (Prime[ n ]^Prime[ n ] + 1)/(Prime[ n ] + 1) ], Print[ Prime[ n ] ] ], {n, 1, 213} ]
    Do[p=Prime[n]; If[PrimeQ[(p^p+1)/(p+1)], Print[p]], {n, 100}] (* T. D. Noe, Oct 20 2003 *)
  • PARI
    forprime(p=3, 1000, if(isprime((p^p+1)/(p+1)), print1(p", "))) \\ Seiichi Manyama, Mar 24 2018

Extensions

Definition corrected by Alexander Adamchuk, Nov 12 2006

A160600 Numbers k such that 3*(2k)^(2k)+1 is prime.

Original entry on oeis.org

1, 2, 3, 5, 143, 225
Offset: 1

Views

Author

M. F. Hasler, Jul 10 2009

Keywords

Comments

This corresponds to the numbers such that 3m^m+1 is prime, but these must all be even, m=2k, and therefore it is more natural to record the sequence of k=m/2.
Next term > 15000. - Matevz Markovic, Oct 09 2012

Examples

			a(1) = 1, because 2^2*3+1 = 13 is the smallest prime of this form.
a(2) = 2, because 4^4*3+1 = 769 is the next smallest prime of this form. a(3) = 3, because 6^6*3+1 = 139969 is again a prime.
		

Crossrefs

Cf. A160360 (3n^n+2 is prime), A121270 = primes among Sierpinski numbers A014566(n)=n^n+1; A216148 = A216147(A110932): primes 2n^n+1; A088790, A065798.

Programs

  • Maple
    q:= k-> isprime(3*(2*k)^(2*k)+1):
    select(q, [$1..225])[];  # Alois P. Heinz, Aug 04 2025
  • PARI
    for(i=1,9999,ispseudoprime(i^i*3+1)&print1(i/2,","))

A374173 a(n) is the smallest prime whose base-n representation contains a run of at least n identical digits.

Original entry on oeis.org

3, 13, 683, 3907, 55987, 960803, 19173967, 435848051, 11111111113, 1540683021299, 19453310068921, 328114698808283, 45302797058044219, 469172025408063623, 19676527011956855059, 878942778254232811943, 120353718818554114936591, 109912203092239643840221
Offset: 2

Views

Author

Robert P. P. McKone, Jun 30 2024

Keywords

Comments

a(2) to a(18) are all increasing, but a(19) is smaller than a(18).
a(n) = A023037(n) for n in A088790. - Robert Israel, Dec 31 2024

Examples

			a(2) = 3 = 11_2.
a(3) = 13 = 111_3.
a(11) = 1540683021299 = 544444444444_11.
a(18) = 120353718818554114936591 = 3111111111111111111_18.
a(19) = 109912203092239643840221 = 1111111111111111111_19.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local t,Q,i,j;
      t:= (n^n-1)/(n-1);
      if isprime(t) then return t fi;
      for i from 1 to n-1 do
        Q:= select(isprime, [seq(i*t*n+j,j=1..n-1),
             seq(i*n^n+j*t,j=1..n-1)]);
        if Q <> [] then return min(Q) fi;
      od;
      FAIL
    end proc:
    map(f, [$2..20]); # Robert Israel, Dec 31 2024
  • Mathematica
    d[n_]:=d[n]=Table[Table[m,n],{m,0,n-1}];
    dpre[n_]:=Flatten[Table[{m}~Join~#&/@d[n],{m,0,n-1}],1];
    dpost[n_]:=Flatten[Table[Map[#~Join~{m}&,d[n]],{m,0,n-1}],1];
    dprepost[n_]:=Flatten[Table[Map[{j}~Join~#~Join~{m}&,d[n]],{m,0,n-1},{j,0,n-1}],2];
    c[n_]:=c[n]=DeleteDuplicates[Sort[Select[FromDigits[#,n]&/@Join[d[n],dpre[n],dpost[n],dprepost[n]],#>n&]]];
    a[n_]:=a[n]=Do[If[PrimeQ[q],Return[q];Break[];],{q,c[n]}];
    Table[a[n],{n,2,19}]

A102604 Numbers k such that ((2*k)^k - 1)/(2*k - 1) is prime.

Original entry on oeis.org

2, 3, 7, 41, 43, 79, 421
Offset: 1

Views

Author

Pierre CAMI, Jan 29 2005

Keywords

Comments

The next k in the sequence is > 4261, if it exists.
Note that (b^k - 1)/(b-1) is prime only if k is prime, so all the elements in this sequence must be primes. - Marco Bodrato (marco2007(AT)bodrato.it), Oct 31 2007
a(8) > 20000, if it exists. - Michael S. Branicky, Aug 12 2024

Examples

			(((2*2)^2) - 1)/(2*2 - 1) = 15/3 = 5 is prime so a(1)=2.
		

Crossrefs

Cf. A088790.

Programs

  • Mathematica
     Select[Prime[Range[100]],PrimeQ[((2#)^#-1)/(2#-1)]&] (* Harvey P. Dale, Mar 09 2022 *)
  • PARI
    lista(nn) = {forprime(n = 2, nn, if (isprime(((2*n)^n-1)/(2*n-1)), print1(n, ", ")););} \\ Michel Marcus, Feb 05 2014

A283515 Numbers k such that sigma(k^(k-1)) is a prime.

Original entry on oeis.org

2, 3, 4, 16, 19, 31, 7547
Offset: 1

Views

Author

Jaroslav Krizek, Mar 10 2017

Keywords

Comments

sigma(k) is the sum of the divisors of k (A000203).
Numbers k such that A000203(A000169(k)) is a prime.
a(8) > 10^4.
Corresponding values of k^(k-1): 2, 9, 64, 1152921504606846976, ...
Corresponding values of sigma(k^(k-1)): 3, 13, 127, 2305843009213693951, ...
Subsequence of A280257 (numbers k such that tau(k^(k-1)) is prime).
Prime terms are in A088790.
For k < 1000, sigma(k^(k+1)) is prime only for k = 5: sigma(5^6) = sigma(15625) = 19531 (prime).

Examples

			sigma(4^3) = sigma(64) = 127 (prime).
		

Crossrefs

Programs

  • Magma
    [n: n in [1..500] | IsPrime(SumOfDivisors(n^(n-1)))];
    
  • Mathematica
    fQ[n_] := PrimeQ[DivisorSigma[1, n^(n - 1)]]; Select[Range@1000, fQ] (* Robert G. Wilson v, Mar 10 2017 *)
  • PARI
    isok(n) = isprime(sigma(n^(n-1))); \\ Michel Marcus, Mar 10 2017

Extensions

a(7) from Giovanni Resta, Mar 10 2017
Showing 1-10 of 11 results. Next