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

A176997 Integers k such that 2^(k-1) == 1 (mod k).

Original entry on oeis.org

1, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 08 2010

Keywords

Comments

Old definition was: Odd integers n such that 2^(n-1) == 4^(n-1) == 8^(n-1) == ... == k^(n-1) (mod n), where k = A062383(n). Dividing 2^(n-1) == 4^(n-1) (mod n) by 2^(n-1), we get 1 == 2^(n-1) (mod n), implying the current definition. - Max Alekseyev, Sep 22 2016
The union of {1}, the odd primes, and the Fermat pseudoprimes, i.e., {1} U A065091 U A001567. Also, the union of A006005 and A001567 (conjectured by Alois P. Heinz, Dec 10 2010). - Max Alekseyev, Sep 22 2016
These numbers were called "fermatians" by Shanks (1962). - Amiram Eldar, Apr 21 2024

Examples

			5 is in the sequence because 2^(5-1) == 4^(5-1) == 8^(5-1) == 1 (mod 5).
		

References

  • Daniel Shanks, Solved and Unsolved Problems in Number Theory, Spartan Books, Washington D.C., 1962.

Crossrefs

The odd terms of A015919.
Odd integers n such that 2^n == 2^k (mod n): this sequence (k=1), A173572 (k=2), A276967 (k=3), A033984 (k=4), A276968 (k=5), A215610 (k=6), A276969 (k=7), A215611 (k=8), A276970 (k=9), A215612 (k=10), A276971 (k=11), A215613 (k=12).

Programs

  • Mathematica
    m = 1; Join[Select[Range[m], Divisible[2^(# - 1) - m, #] &],
    Select[Range[m + 1, 10^3], PowerMod[2, # - 1, #] == m &]] (* Robert Price, Oct 12 2018 *)
  • PARI
    isok(n) = Mod(2, n)^(n-1) == 1; \\ Michel Marcus, Sep 23 2016
    
  • Python
    from itertools import count, islice
    def A176997_gen(startvalue=1): # generator of terms >= startvalue
        if startvalue <= 1:
            yield 1
        k = 1<<(s:=max(startvalue,1))-1
        for n in count(s):
            if k % n == 1:
                yield n
            k <<= 1
    A176997_list = list(islice(A176997_gen(),30)) # Chai Wah Wu, Jun 30 2022

Extensions

Edited by Max Alekseyev, Sep 22 2016

A015935 Positive integers n such that 2^n == 2^11 (mod n).

Original entry on oeis.org

1, 2, 3, 4, 8, 11, 14, 15, 16, 31, 32, 35, 51, 56, 64, 121, 128, 146, 224, 256, 341, 451, 455, 496, 508, 512, 671, 781, 896, 1024, 1111, 1235, 1271, 1441, 1547, 1661, 1736, 1991, 2048, 2091, 2101, 2321, 2651, 2761, 2981, 3091, 3421, 3584, 3641, 3731, 3751, 4064, 4088, 4403, 4411, 4631, 4741, 5071, 5401, 5731, 5951, 6171, 6191, 6281, 6386, 6611, 6851, 6941, 7051, 7271, 7601, 7711, 7936, 8261, 8371, 8435, 8456, 8921
Offset: 1

Views

Author

Keywords

Comments

For all m, 2^A128124(m)-1 belongs to this sequence.

Crossrefs

The odd terms form A276971.

Programs

  • Mathematica
    m = 2^11; Join[Select[Range[m], Divisible[2^# - m, #] &],
    Select[Range[m + 1, 10^6], PowerMod[2, #, #] == m &]] (* Robert Price, Oct 08 2018 *)
  • PARI
    isok(n) = Mod(2, n)^n == Mod(2, n)^11; \\ Michel Marcus, Oct 08 2018

Extensions

Edited by Max Alekseyev, Jul 30 2011

A276967 Odd integers n such that 2^n == 2^3 (mod n).

Original entry on oeis.org

1, 3, 9, 15, 21, 33, 39, 51, 57, 63, 69, 87, 93, 111, 123, 129, 141, 159, 177, 183, 195, 201, 213, 219, 237, 249, 267, 291, 303, 309, 315, 321, 327, 339, 381, 393, 399, 411, 417, 447, 453, 471, 489, 501, 519, 537, 543, 573, 579, 591, 597, 633, 669, 681, 687, 693, 699, 717, 723, 731, 753, 771, 789, 807
Offset: 1

Views

Author

Max Alekseyev, Sep 22 2016

Keywords

Comments

Also, integers n such that 2^(n - 3) == 1 (mod n).
Contains A033553 as a subsequence. Smallest term greater than 3 missing in A033553 is 731.
For all m, 2^A015921(m) - 1 belongs to this sequence.

Crossrefs

The odd terms of A015922.
Odd integers n such that 2^n == 2^k (mod n): A176997 (k = 1), A173572 (k = 2), this sequence (k = 3), A033984 (k = 4), A276968 (k = 5), A215610 (k = 6), A276969 (k = 7), A215611 (k = 8), A276970 (k = 9), A215612 (k = 10), A276971 (k = 11), A215613 (k = 12).

Programs

  • Mathematica
    Join[{1}, Select[Range[1, 1023, 2], PowerMod[2, # - 3, #] == 1 &]] (* Alonso del Arte, Sep 22 2016 *)
  • PARI
    isok(n) = (n % 2) && (Mod(2,n)^n==8); \\ Michel Marcus, Sep 23 2016

A276968 Odd integers n such that 2^n == 2^5 (mod n).

Original entry on oeis.org

1, 3, 5, 25, 65, 85, 145, 165, 185, 205, 221, 265, 305, 365, 445, 465, 485, 505, 545, 565, 685, 745, 785, 825, 865, 905, 965, 985, 1025, 1085, 1145, 1165, 1205, 1285, 1345, 1385, 1405, 1465, 1565, 1585, 1685, 1705, 1745, 1765, 1865, 1925, 1945, 1985, 2005, 2045, 2105, 2165, 2245, 2285, 2305, 2325
Offset: 1

Views

Author

Max Alekseyev, Sep 22 2016

Keywords

Comments

Also, integers n such that 2^(n-5) == 1 (mod n).
Contains A050993 as a subsequence.
For all m, 2^A128122(m)-1 belongs to this sequence.

Crossrefs

The odd terms of A015925.
Odd integers n such that 2^n == 2^k (mod n): A176997 (k=1), A173572 (k=2), A276967 (k=3), A033984 (k=4), this sequence (k=5), A215610 (k=6), A276969 (k=7), A215611 (k=8), A276970 (k=9), A215612 (k=10), A276971 (k=11), A215613 (k=12).

Programs

  • Mathematica
    m = 2^5; Join[Select[Range[1, m, 2], Divisible[2^# - m, #] &],
    Select[Range[m + 1, 10^3, 2], PowerMod[2, #, #] == m &]] (* Robert Price, Oct 12 2018 *)

A276969 Odd integers n such that 2^n == 2^7 (mod n).

Original entry on oeis.org

1, 3, 7, 15, 49, 91, 133, 217, 255, 259, 301, 427, 469, 511, 527, 553, 679, 721, 763, 889, 973, 1015, 1057, 1099, 1141, 1267, 1351, 1393, 1477, 1561, 1603, 1687, 1897, 1939, 1981, 2107, 2149, 2191, 2317, 2359, 2443, 2569, 2611, 2653, 2779, 2863, 2947, 3031, 3073, 3199, 3241, 3409, 3493, 3661, 3787
Offset: 1

Views

Author

Max Alekseyev, Sep 22 2016

Keywords

Comments

Also, integers n such that 2^(n-7) == 1 (mod n).
Contains A208155 as a subsequence.
For all m, 2^A015922(m)-1 belongs to this sequence.

Crossrefs

The odd terms of A015927.
Odd integers n such that 2^n == 2^k (mod n): A176997 (k=1), A173572 (k=2), A276967 (k=3), A033984 (k=4), A276968 (k=5), A215610 (k=6), this sequence (k=7), A215611 (k=8), A276970 (k=9), A215612 (k=10), A276971 (k=11), A215613 (k=12).

Programs

  • Mathematica
    m = 2^7; Join[Select[Range[1, m, 2], Divisible[2^# - m, #] &],
    Select[Range[m + 1, 10^3, 2], PowerMod[2, #, #] == m &]] (* Robert Price, Oct 12 2018 *)
  • PARI
    is(n)=n%2 && Mod(2,n)^n==128 \\ Charles R Greathouse IV, Sep 22 2016

A276970 Odd integers n such that 2^n == 2^9 (mod n).

Original entry on oeis.org

1, 3, 5, 9, 17, 21, 27, 45, 63, 99, 105, 117, 153, 171, 189, 207, 261, 273, 279, 333, 369, 387, 423, 429, 477, 513, 531, 549, 585, 603, 639, 657, 711, 747, 801, 873, 909, 927, 945, 963, 981, 1017, 1143, 1179, 1197, 1209, 1233, 1251, 1341, 1359, 1365, 1413, 1467, 1503, 1557, 1611, 1629, 1665, 1719, 1737
Offset: 1

Views

Author

Max Alekseyev, Sep 22 2016

Keywords

Comments

Also, integers n such that 2^(n-9) == 1 (mod n).
Contains A208157 as a subsequence.
For all m, 2^A128123(m)-1 belongs to this sequence.

Crossrefs

The odd terms of A015931.
Odd integers n such that 2^n == 2^k (mod n): A176997 (k=1), A173572 (k=2), A276967 (k=3), A033984 (k=4), A276968 (k=5), A215610 (k=6), A276969 (k=7), A215611 (k=8), this sequence (k=9), A215612 (k=10), A276971 (k=11), A215613 (k=12).

Programs

  • Mathematica
    m = 2^9; Join[Select[Range[1, m, 2], Divisible[2^# - m, #] &], Select[Range[m + 1, 10^3, 2], PowerMod[2, #, #] == m &]] (* Robert Price, Oct 15 2018 *)

A385073 a(n) = b^(n-1) mod n, where b = A053669(n) is the least integer greater than 1 and coprime to n.

Original entry on oeis.org

0, 1, 1, 3, 1, 5, 1, 3, 4, 3, 1, 5, 1, 3, 4, 11, 1, 11, 1, 7, 4, 3, 1, 5, 16, 3, 13, 27, 1, 7, 1, 11, 4, 3, 9, 29, 1, 3, 4, 27, 1, 17, 1, 27, 31, 3, 1, 29, 15, 33, 4, 27, 1, 11, 49, 3, 4, 3, 1, 43, 1, 3, 4, 43, 16, 23, 1, 27, 4, 13, 1, 29, 1, 3, 34, 27, 9, 5, 1, 27, 40, 3, 1, 17
Offset: 1

Views

Author

Robert G. Wilson v, Jun 16 2025

Keywords

Comments

Inspired by Fermat's Little Theorem.
a(n) > 0 for n > 1 since n and b are coprime.

Crossrefs

Programs

  • Maple
    f:= proc(n) local b;
      b:= 2;
      while n mod b = 0 do b:= nextprime(b) od;
      b &^ (n-1) mod n
    end proc:
    f(1):= 0:
    map(f, [$1..100]); # Robert Israel, Jun 18 2025
  • Mathematica
    a[n_] := Block[{b = 2}, While[GCD[n, b] > 1, b++]; PowerMod[b, n - 1, n]]; Array[a, 84]
  • PARI
    a(n) = forprime(p=2, , if(n%p, return(lift(Mod(p, n)^(n-1))))); \\ Michel Marcus, Jun 18 2025

Formula

a(n) = 0 iff n = 1.
a(n) = 1 iff n belongs to A000040, A001567, or A130433.
a(n) = 2 iff n>1 and belongs to A173572;
a(n) = 4 iff n belongs to A033553;
a(n) = 8 iff n>7 and belongs to either A033984 or A173138;
a(n) = 16 iff n>15 and belongs to A276968;
a(n) = 32 iff n>1 and belongs to A215610;
a(n) = 64 iff n>63 and belongs to A276969;
a(n) = 128 iff n>127 and belongs to A215611;
a(n) = 256 iff n>255 and belongs to A276970;
a(n) = 512 iff n>511 and belongs to A215612;
a(n) = 1024 iff n>1023 and belongs to A276971;
a(n) = 2048 iff n>2047 and belongs to A215613;
From Robert Israel, Jun 18 2025: (Start)
a(2*p) = 3 if p is a prime > 3.
a(3*p) = 4 if p is a prime > 2.
a(4*p) = 3^3 if p is a prime > 5.
a(6*p) = 5^5 if p is a prime > 509.
a(8*p) = 3^5 if p is a prime > 271.
a(10*p) = 3^9 if p is a prime > 1951.
a(12*p) = 5^11 if p is a prime > 4069003. (End)
Showing 1-7 of 7 results.