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

A152597 Where records occur in A001917.

Original entry on oeis.org

2, 4, 11, 21, 31, 110, 124, 185, 279, 399, 716, 1028, 4552, 6207, 6543, 11424, 11557, 12251, 16199, 23043, 43390, 155798, 203095, 457523, 699782, 865318, 1294026, 2918851, 5635889, 6459777, 8999147, 9213126, 22383796, 28194383, 32131750, 105097565, 404165580
Offset: 1

Views

Author

Klaus Brockhaus, Dec 09 2008

Keywords

Examples

			First few terms of A001917 (has offset 2) are 1, 1, 2, 1, 1, 2, 1, 2, 1, 6, so a(1) to a(3) are 2, 4, 11.
		

Crossrefs

Cf. A001917 ((p-1)/x, where p = prime(n) and x = smallest positive integer such that 2^x == 1 mod p), A152598 (records in A001917), A000720, A226216.

Programs

  • Magma
    W:=[]; r:=0; for n in [2..100000] do p:=NthPrime(n); a:=(p-1)/Modorder(2, p); if r lt a then r:=a; Append(~W,n); end if; end for; print W;
    
  • Python
    from itertools import islice
    from sympy import nextprime, n_order
    def agen():
        record, v, p = -1, 1, 3
        while True:
            if v > record: record = v; yield record
            v, p = (p-1)//n_order(2, p), nextprime(p)
    print(list(islice(agen(), 20))) # Michael S. Branicky, Oct 09 2022

Formula

a(n) = A000720(A226216(n)). - Amiram Eldar, Nov 16 2023

Extensions

a(27)-a(37) from Amiram Eldar, Mar 08 2019

A367319 Base-2 Fermat pseudoprimes k such that (k-1)/ord(2, k) > (m-1)/ord(2, m) for all base-2 Fermat pseudoprimes m < k, where ord(2, k) is the multiplicative order of 2 modulo k.

Original entry on oeis.org

341, 1105, 1387, 2047, 4369, 4681, 5461, 13981, 15709, 35333, 42799, 60787, 126217, 158369, 215265, 256999, 266305, 486737, 617093, 1082401, 1398101, 2113665, 2304167, 4025905, 4188889, 4670029, 6236473, 6242685, 8388607, 13757653, 16843009, 17895697, 22369621
Offset: 1

Views

Author

Amiram Eldar, Nov 14 2023

Keywords

Crossrefs

Subsequence of A001567.

Programs

  • Mathematica
    pspQ[n_] := CompositeQ[n] && PowerMod[2, n - 1, n] == 1; seq[kmax_] := Module[{s = {}, r, rm = 0}, Do[If[pspQ[k], r = (k - 1)/MultiplicativeOrder[2, k]; If[r > rm, rm = r; AppendTo[s, k]]], {k, 1, kmax}]; s]; seq[10^6]
  • PARI
    ispsp(n) = n > 1 && n % 2 && Mod(2, n)^(n-1) == 1 && !isprime(n);
    lista(kmax) = {my(r, rm = 0); for(k = 1, kmax, if(ispsp(k), r = (k-1)/znorder(Mod(2, k)); if(r > rm, rm = r; print1(k, ", "))));}

A367320 Carmichael numbers k such that (k-1)/lambda(k) > (m-1)/lambda(m) for all Carmichael numbers m < k, where lambda is the Carmichael lambda function (A002322).

Original entry on oeis.org

561, 1105, 1729, 29341, 41041, 63973, 172081, 825265, 852841, 1773289, 5310721, 9890881, 12945745, 18162001, 31146661, 93869665, 133205761, 266003101, 417241045, 496050841, 509033161, 1836304561, 1932608161, 2414829781, 4579461601, 9799928965, 11624584621, 12452890681
Offset: 1

Views

Author

Amiram Eldar, Nov 14 2023

Keywords

Crossrefs

Subsequence of A002997.

Programs

  • Mathematica
    seq[kmax_] := Module[{s = {}, r, rm = 0, lam}, Do[If[CompositeQ[k], lam = CarmichaelLambda[k]; If[Mod[k, lam] == 1, r = (k - 1)/lam; If[r > rm, rm = r; AppendTo[s, k]]]], {k, 9, kmax, 2}]; s]; seq[10^6]
  • PARI
    lista(kmax) = {my(r, rm = 0, lam); forcomposite(k = 4, kmax, if(k % 2, lam = lcm(znstar(k)[2]); if(k % lam == 1, r = (k-1)/lam; if(r > rm, rm = r; print1(k, ", ")))));}
Showing 1-3 of 3 results.