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-5 of 5 results.

A162002 Numbers n for which 2^^n == 2^2^n (mod n); for the "^^" notation see A092188.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 10, 12, 14, 15, 16, 17, 18, 20, 24, 26, 28, 30, 32, 34, 36, 40, 42, 43, 44, 46, 48, 51, 52, 56, 58, 60, 64, 68, 70, 72, 76, 78, 80, 84, 85, 88, 90, 96, 100, 102, 104, 112, 120, 124, 126, 127, 128, 130, 132, 136, 140, 141, 144, 145, 148, 156, 160, 164
Offset: 1

Views

Author

Robert Munafo, Jun 24 2009

Keywords

Examples

			3 is in the sequence because 2^2^3 = 2^8 = 256 == 1 mod 3, and 2^^3 = 2^2^2 = 2^4 = 16 == 1 mod 3.
		

Crossrefs

A162018 Numbers n for which 2^^n != 2^2^n (mod n); for the "^^" notation see A092188.

Original entry on oeis.org

7, 9, 11, 13, 19, 21, 22, 23, 25, 27, 29, 31, 33, 35, 37, 38, 39, 41, 45, 47, 49, 50, 53, 54, 55, 57, 59, 61, 62, 63, 65, 66, 67, 69, 71, 73, 74, 75, 77, 79, 81, 82, 83, 86, 87, 89, 91, 92, 93, 94, 95, 97, 98, 99, 101, 103, 105, 106, 107, 108, 109, 110, 111, 113, 114, 115
Offset: 1

Views

Author

Robert Munafo, Jun 24 2009

Keywords

Examples

			7 is in the sequence because 2^2^7 = 2^128 == 4 mod 7, but 2^^7 = 2^2^2^2^2^2^2 == 2 mod 7.
		

Crossrefs

A094358 Squarefree products of factors of Fermat numbers (A023394).

Original entry on oeis.org

1, 3, 5, 15, 17, 51, 85, 255, 257, 641, 771, 1285, 1923, 3205, 3855, 4369, 9615, 10897, 13107, 21845, 32691, 54485, 65535, 65537, 114689, 163455, 164737, 196611, 274177, 319489, 327685, 344067, 494211, 573445, 822531, 823685, 958467, 974849, 983055
Offset: 1

Views

Author

Robert Munafo, Apr 26 2004

Keywords

Comments

641 is the first member not in sequences A001317, A004729, etc.
Conjectured (by Munafo, see link) to be the same as: numbers n such that 2^^n == 1 mod n, where 2^^n is A014221(n).
It is clear from the observations by Max Alekseyev in A023394 and the Chinese remainder theorem that any squarefree product b of divisors of Fermat numbers satisfies 2^(2^b) == 1 (mod b), hence satisfies Munafo's congruence above. The converse is true iff all Fermat numbers are squarefree. However, if nonsquarefree Fermat numbers exist, the criterion that is equivalent with Munafo's property would be "numbers b such that each prime power that divides b also divides some Fermat number". - Jeppe Stig Nielsen, Mar 05 2014
Also numbers b such that b is (squarefree and) a divisor of A051179(m) for some m. Or odd (squarefree) b where the multiplicative order of 2 mod b is a power of two. - Jeppe Stig Nielsen, Mar 07 2014
From Jianing Song, Nov 11 2023: (Start)
Also squarefree numbers k such that there exists i >= 1 such that k divides 2^^i - 1, where 2^^i = 2^2^...^2 (i times) = A014221(i): 2^^i == 1 (mod k) if and only if ord(2,k) divides 2^^(i-1) (ord(a,k) is the multiplicative order of a modulo k), so such i exists if and only if ord(2,k) is a power of 2. For such k, k divides 2^^i - 1 if and only if 2^^(i-2) >= log_2(ord(2,k)).
Note that 2^^(i-1) divides 2^^i implies that 2^^i - 1 divides 2^^(i+1) - 1, so this sequence is also squarefree numbers k such that k divides 2^^i - 1 for all sufficiently large i. (End)

Examples

			3 is a term because it is in A023394.
51 is a term because it is 3*17 and 17 is also in A023394.
153 = 3*3*17 is not a term because its factorization includes two 3's.
See the Munafo link for examples of the (conjectured) 2^^n == 1 (mod n) property.
		

Crossrefs

Programs

  • Mathematica
    kmax = 10^6;
    A023394 = Select[Prime[Range[kmax]], IntegerQ[Log[2, MultiplicativeOrder[2, #] ] ]&];
    Reap[For[k = 1, k <= kmax, k++, ff = FactorInteger[k]; If[k == 1 || AllTrue[ff, MemberQ[A023394, #[[1]]] && #[[2]] == 1 &], Print[k]; Sow[k]]]][[2, 1]] (* Jean-François Alcover, Nov 03 2018 *)
  • PARI
    (  isOK1(n) = n%2==1 && hammingweight(znorder(Mod(2,n)))==1  ) ;  (  isOK2(n) = issquarefree(n) && isOK1(n)  )  \\ isOK1 and isOK2 differ only if n contains a squared prime that divides a Fermat number (none are known) \\ Jeppe Stig Nielsen, Apr 02 2014

Extensions

Edited by T. D. Noe, Feb 02 2009
Example brought in line with name/description by Robert Munafo, May 18 2011

A213013 (2^3^4^5^...^n) mod n.

Original entry on oeis.org

0, 2, 0, 2, 2, 1, 0, 8, 2, 2, 8, 5, 8, 2, 0, 2, 8, 18, 12, 8, 2, 16, 8, 2, 18, 26, 8, 11, 2, 2, 0, 2, 2, 22, 8, 31, 18, 5, 32, 2, 8, 27, 24, 17, 16, 8, 32, 43, 2, 2, 44, 45, 26, 2, 8, 56, 40, 47, 32, 33, 2, 8, 0, 57, 2, 5, 36, 62, 22, 60, 8, 1, 68, 2, 56, 57, 44, 8, 32, 80, 2, 2, 8, 2
Offset: 2

Views

Author

Max Alekseyev, Jun 02 2012

Keywords

Comments

a(n) = 0 iff n is a power of 2.

Crossrefs

A variant of A092188.

Programs

  • PARI
    { a(n,m=n,s=2) = local(g); if(s==n, return(n%m)); g=factor(gcd(s,m)); for(i=1,matsize(g)[1], g[i,2]=valuation(m,g[i,1]); m\=g[i,1]^g[i,2]); g=prod(i=1,matsize(g)[1],g[i,1]^g[i,2]); lift( chinese( Mod(0,g), Mod(s,m)^a(n,eulerphi(m),s+1) )) }

A373495 a(1) = 2; thereafter, a(n) = prime(n)^prime(n-1) (mod 10).

Original entry on oeis.org

2, 9, 5, 7, 1, 7, 7, 9, 7, 9, 1, 3, 1, 3, 3, 7, 9, 1, 7, 1, 7, 9, 7, 9, 7, 1, 3, 3, 9, 3, 7, 1, 3, 9, 9, 1, 3, 3, 3, 7, 9, 1, 1, 7, 7, 9, 1, 7, 3, 9, 3, 9, 1, 1, 3, 3, 9, 1, 3, 1, 3, 7, 7, 1, 7, 7, 1, 3, 7, 9, 3, 9, 3, 7, 9, 7, 9, 7, 1, 9, 9, 1, 1, 7, 9, 7, 9, 7, 1, 3, 3, 9, 3, 1, 9, 7, 9, 1, 3, 1, 7, 3, 3, 9, 1
Offset: 1

Views

Author

Robert G. Wilson v, Jun 06 2024

Keywords

Comments

This sequence is not periodic.

Examples

			a(2) = 3^2 (mod 10) = 9.
a(3) = 5^3 (mod 10) = 5.
		

References

  • Ilan Vardi, "Computational Recreations in Mathematica," Addison-Wesley Publishing, Redwood City, CA, 1991, p. 226-229.

Crossrefs

Programs

  • Mathematica
    a[n_] := Switch[ Mod[ Prime[n], 10], 1, 1, 3, If[ Mod[ Prime[n -1], 4] == 1, 3, 7], 5, 5, 7, If[ Mod[ Prime[n -1], 4] == 1, 7, 3], 9, 9]; a[1] = 2; a[2] = 9; Array[a, 105]
    Join[{2}, Map[PowerMod[#[[2]], #[[1]], 10] &, Partition[Prime[Range[100]], 2, 1]]] (* Paolo Xausa, Jul 14 2025 *)
  • PARI
    a(n) = if(n<2, 2, lift(Mod(prime(n),10)^prime(n-1))) \\ Hugo Pfoertner, Jul 07 2024

Formula

a(n) = A078422(n-1) mod 10. - R. J. Mathar, Jul 14 2025
Showing 1-5 of 5 results.