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

A372894 A positive integer 2^k*m, where m is odd and k >= 0, belongs to this sequence iff the Jacobi symbol (F_n/m) = -1 for only a finite number of Fermat numbers F_n = A000215(n).

Original entry on oeis.org

1, 2, 4, 8, 9, 13, 15, 16, 17, 18, 21, 25, 26, 30, 32, 34, 35, 36, 42, 49, 50, 52, 60, 64, 68, 70, 72, 81, 84, 97, 98, 100, 104, 117, 120, 121, 123, 128, 135, 136, 140, 144, 153, 162, 168, 169, 189, 193, 194, 195, 196, 200, 205, 208, 221, 225, 234, 240, 241, 242, 246, 255, 256, 257, 270, 272, 273, 280, 287, 288, 289
Offset: 1

Views

Author

Jianing Song, May 15 2024

Keywords

Comments

Can be seen as the opposite of A129802.
Let m be an odd number and ord(2,m) = 2^r*d be the multiplicative order of 2 modulo m, where d is odd, then 2^2^n + 1 is congruent to one of 2^2^r + 1, 2^2^(r+1) + 1, ..., 2^2^(r+ord(2,d)-1) + 1 modulo m, so it suffices to check these ord(2,d) numbers.
Note that if m > 1, then m does not divide 2^2^n + 1 for n >= r, otherwise we would have 2^(2^n*d) = (2^ord(2,m))^2^(n-r) == 1 (mod m) and 2^(2^n*d) = (2^2^n)^d == (-1)^d == -1 (mod m). As a result, m is a term if and only if the Jacobi symbol ((2^2^n + 1)/m) is equal to 1 for m = r, r+1, ..., r+ord(2,d)-1.
By definition, a squarefree number that is a product of elite primes (A102742) or anti-elite primes (A128852) is a term if and only if its number of elite factors is even. But a squarefree term can have factors that are neither elite nor anti-elite, the smallest being 341 = 11*31.
Contains divisors of Fermat numbers >= 17 (A307843 \ {3,5}) since they are products of elite primes.

Examples

			For n >= 1, we have 2^2^n + 1 == 65, 5, 17, 257 (mod 341) respectively for n == 0, 1, 2, 3 (mod 4). As we have (65/341) = (5/341) = (17/341) = (257/341) = 1, 341 is a term.
		

Crossrefs

Prime elements of this sequence are given by A128852.

Programs

  • PARI
    isA372894(n) = n = (n >> valuation(n,2)); my(d = znorder(Mod(2, n)), StartPoint = valuation(d, 2), LengthTest = znorder(Mod(2, d >> StartPoint))); for(i = StartPoint, StartPoint + LengthTest - 1, if(kronecker(lift(Mod(2, n)^2^i + 1), n) == -1, return(0))); 1

A057755 Number of digits in n-th Fermat number (A000215).

Original entry on oeis.org

1, 1, 2, 3, 5, 10, 20, 39, 78, 155, 309, 617, 1234, 2467, 4933, 9865, 19729, 39457, 78914, 157827, 315653, 631306, 1262612, 2525223, 5050446, 10100891, 20201782, 40403563, 80807125, 161614249, 323228497, 646456994, 1292913987, 2585827973
Offset: 0

Views

Author

Robert G. Wilson v, Oct 30 2000

Keywords

Comments

Also number of digits of A001146(n) and A051179(n). - Michel Marcus, Dec 21 2018

Examples

			a(6) = 20 because 2^(2^6) + 1 = 18446744073709551617 which is a twenty-digit number.
		

References

  • John H. Conway and R. K. Guy, The Book of Numbers, Copernicus, an imprint of Springer-Verlag, NY, 1995, page 139.

Crossrefs

Programs

  • GAP
    List([0..18],n->Size(ListOfDigits(2^(2^n)+1))); # Muniru A Asiru, Dec 20 2018
  • Magma
    [Floor(2^n*Log(10,2)/Log(10,10))+1: n in [0..40]]; // Vincenzo Librandi, Nov 08 2018
    
  • Maple
    seq(length(2^(2^n)),n=0..20); # Zerinvary Lajos, Apr 20 2008
  • Mathematica
    Table[ Floor[ 2^n * N[ Log[ 10, 2 ], 24 ] + 1 ], {n, 0, 43} ]
  • PARI
    for(n=0, 50, print(n, " ", floor(2^n*log(2)/log(10))+1); ) \\ Jinyuan Wang, Nov 07 2018
    

Formula

a(n) = floor(log_10(F_n)+1) (F_n is the n-th Fermat number). - Ivan Panchenko, Sep 06 2009

A162634 Numerators of fractions with denominators A000215(n) approximating the Thue-Morse constant.

Original entry on oeis.org

1, 2, 7, 106, 27031, 1771476586, 7608434000728254871, 140350834813144189858090274002849666666, 47758914269546354982683078068829456704164423862093743397580034411621752859031
Offset: 0

Views

Author

Vladimir Shevelev, Jul 08 2009, Jul 14 2009

Keywords

Comments

One can prove that if in the sequence of numbers N for which A010060(N+2^n)= A010060(N) you replace the odious (evil) terms by 1's (0's), then we obtain 2^(n+1)-periodic (0,1)-sequence; if you write it in the form .xx...,i.e., as a binary infinite fraction, then the corresponding fraction has the form a(n)/A000215(n). These fractions very fast converge to the Thue-Morse constant .4124540336401...; e.g a(5)/(2^32+1) approximates this constant up to 10^(-9). These approximations differ from A074072-A074073. Conjecture. For n>=1, the fraction a(n)/A000215(n) is a convergent corresponding to the continued fraction for the Thue-Morse constant.

Crossrefs

Programs

  • PARI
    a(n)=if(n<=1, [1,2][n+1], 1+(2^(2^(n-1))-1)*a(n-1)); /* Joerg Arndt, Mar 11 2013 */

Formula

a(1)=2, and, for n>=2, a(n) = 1 + (2^(2^(n-1))-1) * a(n-1).

Extensions

Added more terms, Joerg Arndt, Mar 11 2013

A308695 a(n) is the minimum positive integer m such that m * 2^(n + 2) + 1 is a prime number which does not divide ((F(n + 2) - 1)^m - 1)/(F(n + 2) - 2), where F(n) is the n-th Fermat number (A000215).

Original entry on oeis.org

1, 2, 1, 8, 4, 2, 1, 128, 64, 32, 16, 8, 4, 2, 1, 6300, 3150, 26, 13, 579, 1069378, 534689, 10, 5, 387304, 193652, 96826, 48413, 141015, 298082, 149041, 2958, 1479, 51418638746, 25709319373, 20, 10, 5, 6, 3
Offset: 0

Views

Author

Keywords

Comments

Note that some terms are obtained by dividing the previous one by 2.
From Jinyuan Wang, Feb 18 2020: (Start)
a(n) is the least m such that q = m*2^(n + 2) + 1 is a prime factor of F(n + 2) - 2. Proof: if r(n + 2)/s(n + 2) = ((F(n + 2) - 1)^m - 1)/(F(n + 2) - 2) is not divisible by q, then q divides s(n + 2) because r(n + 2) is always divisible by q (by Fermat's little theorem). Also note that if F(n + 2) - 1 == 1 (mod q), then r(n + 2)/s(n + 2) = Sum_{i = 0..m-1} A001146(n + 2)^i == m (mod q). In conclusion, prime q = m*2^(n + 2) + 1 does not divide r(n + 2)/s(n + 2) if and only if q divides F(n + 2) - 2 = Product_{i = 0..n + 1} F(i).
a(n) always exists because prime factors of F(n) are of the form k*2^(n + 2) + 1. a(n) is not greater than the smallest such k. (End)
a(40) <= 74327396788321657. - Max Alekseyev, Nov 17 2022

Examples

			2 is the minimum positive integer m such that m * 2^(1 + 2) + 1 is a prime number (note that 2 * 2^(1 + 2) + 1 = 17) which does not divide ((F(1 + 2) - 1)^m - 1)/(F(1 + 2) - 2) (note that ((F(1 + 2) - 1)^2 - 1)/(F(1 + 2) - 2) = 257, which is a prime number).
		

Crossrefs

Cf. A000215 (Fermat numbers), A001146.

Programs

  • Maple
    A308695:=proc(n)
       local m:
       m:=1:
       while not isprime(m*2^(n+2)+1) or (2^(2^(n+2))-1) mod (m*2^(n+2)+1) != 0 do
          m:=m+1:
       od:
       return m:
    end proc:
  • Mathematica
    Array[Block[{m = 1}, While[Nand[PrimeQ[#4], Mod[((#3 - 1)^#1 - 1)/(#3 - 2), #4] != 0] & @@ {m, #, 2^(2^(# + 2)) + 1, m*2^(# + 2) + 1}, m++]; m] &, 14] (* Michael De Vlieger, Feb 14 2020 *)
  • PARI
    F(n) = 2^(2^n) + 1;
    a(n) = {my(m=1); while (!isprime(p=(m*2^(n+2)+1)) || !((((F(n+2)-1)^m-1)/ (F(n+2)-2)) % p), m++); m;} \\ Michel Marcus, Feb 14 2020
    
  • PARI
    a(n) = {my(d=4*2^n, q=1); for(m=1, oo, q+=d; if(ispseudoprime(q) && Mod(2, q)^d==1, return(m))); } \\ Jinyuan Wang, Feb 18 2020

Extensions

a(15)-a(32) from Jinyuan Wang, Feb 18 2020
a(33)-a(39) from Max Alekseyev, Nov 17 2022

A332414 Positive integers r such that A(1,r) = A(2,r - 1) = ... = A(r,1) = 0, where A denotes the function mapping every pair of positive integers (m,n) into 1 if m * 2^(n + 2) + 1 is a prime number dividing F(n + 2) - 2, where F(n) denotes the n-th Fermat number (i.e., F(n) = A000215(n)); and into 0 otherwise.

Original entry on oeis.org

1, 3, 4, 5, 8, 11, 12, 16, 19, 20, 21, 22, 23, 26, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39, 44, 46, 47, 51, 52, 53, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 74, 75, 76, 78, 80, 82, 84, 85, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 99, 100, 101
Offset: 1

Views

Author

Keywords

Comments

Note that this sequence is a subsequence of A332416.
Prime q = m*2^(n + 2) + 1 does not divide ((F(n + 2) - 1)^m - 1)/(F(n + 2) - 2) if and only if q divides F(n + 2) - 2 = Product_{i = 0..n + 1} F(i). Direct implication is Theorem 2.26 of my article (see the links) and reciprocal implication is due to Wang (see A308695).

Examples

			3 is a term of this sequence, because A(1,3) = A(2,2) = A(3,1) = 0.
		

Crossrefs

Cf. A000215 (Fermat numbers), A308695, A332416.

Programs

  • Maple
    A332414:=proc(n)
       local c, i, k, q, r, v:
       c:=0:
       i:=0:
       r:=1:
       while c < n do
          for k from 0 to r-1 do
             q:=(k+1)*2^(r-k+2)+1:
             if not isprime(q) or (2^(2^(r-k+2)) - 1) mod q != 0 then
                i:=i+1:
             fi:
          od:
          if i = r then
             v:=r:
             c:=c+1:
          fi:
          i:=0:
          r:=r+1:
       od:
       return v:
    end proc:
  • Mathematica
    Select[Range@ 29, NoneTrue[Transpose@ {#, Reverse@ #} &@ Range@ #, And[PrimeQ[#4], Mod[((#3 - 1)^#1 - 1)/(#3 - 2), #4] != 0] & @@ {#1, #2, 2^(2^(#2 + 2)) + 1, #1*2^(#2 + 2) + 1} & @@ # &] &] (* Michael De Vlieger, Feb 14 2020 *)
  • PARI
    isA(m, t) = ispseudoprime(q=4*m*2^t+1) && Mod(2, q)^(4*2^t)==1;
    isok(r) = sum(i=1, r, isA(i, r-i+1)) == 0; \\ Jinyuan Wang, Feb 18 2020

Extensions

a(17)-a(67) from Jinyuan Wang, Feb 18 2020

A332416 Positive integers r such that B(1,r) = B(2,r - 1) = ... = B(r,1) = 0, where B denotes the function mapping every pair of positive integers (m,n) into 1 if m * 2^(n + 2) + 1 is a prime number dividing F(n), where F(n) denotes the n-th Fermat number (i.e., F(n) = A000215(n)); and into 0 otherwise.

Original entry on oeis.org

1, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 79
Offset: 1

Views

Author

Keywords

Comments

Note that A332414 is a subsequence of this sequence.
Prime q = m*2^(n + 2) + 1 does not divide ((F(n + 2) - 1)^m - 1)/F(n) if and only if q divides F(n). Direct implication is Theorem 2.24 of my article (see the links). Proof of the reciprocal implication (by Wang): A001146(n) = 2^(2^n) == - 1 (mod q), so ((F(n + 2) - 1)^m - 1)/F(n) = Sum_{i = 0..4*m-1} (-1)^(i+1)*(2^(2^n))^i == -4*m (mod q).

Examples

			3 is a term of this sequence, because B(1,3) = B(2,2) = B(3,1) = 0.
		

Crossrefs

Cf. A000215 (Fermat numbers), A001146, A332414.

Programs

  • Maple
    A332416:=proc(n)
       local c, i, k, q, r, v:
       c:=0:
       i:=0:
       r:=1:
       while c < n do
          for k from 0 to r-1 do
             q:=(k+1)*2^(r-k+2)+1:
             if not isprime(q) or (2^(2^(r-k)) + 1) mod q != 0 then
                i:=i+1:
             fi:
          od:
          if i = r then
             v:=r:
             c:=c+1:
          fi:
          i:=0:
          r:=r+1:
       od:
       return v:
    end proc:
  • Mathematica
    Select[Range@ 29, NoneTrue[Transpose@ {#, Reverse@ #} &@ Range@ #, And[PrimeQ[#4], Mod[((#3 - 1)^#1 - 1)/(2^(2^#2) + 1), #4] != 0] & @@ {#1, #2, 2^(2^(#2 + 2)) + 1, #1*2^(#2 + 2) + 1} & @@ # &] &] (* Michael De Vlieger, Feb 14 2020 *)
  • PARI
    isB(m, t) = ispseudoprime(q=4*m*2^t+1) && Mod(2, q)^(2^t)==-1;
    isok(r) = sum(i=1, r, isB(i, r-i+1)) == 0; \\ Jinyuan Wang, Feb 18 2020

Extensions

a(25)-a(68) from Jinyuan Wang, Feb 18 2020

A063897 a(n) is the least k such that k - A000215(j), j=0..n, are all primes.

Original entry on oeis.org

5, 8, 22, 274, 65704, 4295145556, 18446744073810262144
Offset: 0

Views

Author

Felice Russo, Aug 29 2001

Keywords

Comments

Is this sequence finite?
The prime k-tuples conjecture implies that the sequence is infinite. - Robert Israel, Jul 11 2016

Examples

			For j=0 a(0)=5 because 5-3 is prime.
For j=1 a(1)=8 because 8-5, 8-3 are all primes.
For j=2 a(2)=22 because 22-17, 22-5, 22-3 are all primes.
For j=3 a(3)=274 because 274-257, 274-17, 274-5, 274-3 are all primes.
		

Crossrefs

Cf. A000215.

Programs

  • Maple
    f:= proc(n) local r, j, good;
        for r from 2^(2^n)+4 by 2 do
           good:= true;
           for j from 0 to n do
              if not isprime(r - 2^(2^j)-1) then good:= false; break fi
           od;
           if good then return(r) fi
        od
    end proc:
    f(0):= 5:
    map(f, [$0..5]); # Robert Israel, Jul 11 2016
  • PARI
    okprime(mink, vecf) = {for (i = 1, #vecf, if (! isprime(mink - vecf[i]), return (0));); return (1);}
    a(n) = {mink = 2^(2^n) + 2; vecf = vector(n+1, i, 2^(2^(i-1)) + 1); while (! okprime(mink, vecf), mink++); mink;} \\ Michel Marcus, Sep 28 2013

Extensions

18446744073810262144 from Thomas Baruchel, Oct 21 2003

A133026 Concatenation of next n Fermat numbers A000215.

Original entry on oeis.org

3, 517, 257655374294967297
Offset: 1

Views

Author

Omar E. Pol, Nov 09 2007

Keywords

Comments

a(4) has 292 digits and is too large to include.

Crossrefs

Programs

  • Mathematica
    a[n_] := FromDigits[Flatten[IntegerDigits[Table[2^(2^(k - 1)) + 1, {k, n*(n - 1)/2 + 1, n*(n + 1)/2}]]]]; Array[a, 3] (* Amiram Eldar, Jul 09 2025 *)

A133045 Successive digits of Fermat numbers A000215(n).

Original entry on oeis.org

3, 5, 1, 7, 2, 5, 7, 6, 5, 5, 3, 7, 4, 2, 9, 4, 9, 6, 7, 2, 9, 7, 1, 8, 4, 4, 6, 7, 4, 4, 0, 7, 3, 7, 0, 9, 5, 5, 1, 6, 1, 7, 3, 4, 0, 2, 8, 2, 3, 6, 6, 9, 2, 0, 9, 3, 8, 4, 6, 3, 4, 6, 3, 3, 7, 4, 6, 0, 7, 4, 3, 1, 7, 6, 8, 2, 1, 1, 4, 5, 7
Offset: 1

Views

Author

Omar E. Pol, Nov 10 2007

Keywords

Crossrefs

Programs

  • Mathematica
    IntegerDigits[Table[2^(2^n) + 1, {n, 0, 10}]] // Flatten (* G. C. Greubel, Oct 03 2017 *)

A273037 Discriminator of the first n Fermat numbers A000215.

Original entry on oeis.org

1, 3, 5, 11, 11, 19, 19, 23, 23, 23, 47, 53, 53, 53, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 163, 163, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167
Offset: 1

Views

Author

Jeffrey Shallit, May 13 2016

Keywords

Comments

The discriminator of a sequence is the least positive integer k such that the first n terms are pairwise inequivalent, modulo k.

Crossrefs

Cf. A000215.
Showing 1-10 of 245 results. Next