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

A108574 Range of A000790 (primary pretenders).

Original entry on oeis.org

4, 6, 9, 10, 14, 15, 21, 22, 25, 26, 33, 34, 38, 39, 46, 49, 51, 57, 58, 62, 65, 69, 74, 82, 85, 86, 87, 91, 93, 94, 106, 111, 118, 121, 122, 123, 129, 133, 134, 141, 142, 145, 146, 158, 159, 166, 169, 177, 178, 183, 185, 194, 201, 202, 205, 206, 213, 214, 217, 218, 219, 226, 237, 249, 254, 259, 262, 265, 267, 274, 278, 289, 291, 298, 301, 302, 303, 305, 309, 314, 321, 326, 327, 334, 339, 341, 346, 358, 361, 362, 365, 381, 382, 386, 393, 394, 398, 411, 417, 422, 427, 445, 446, 447, 451, 453, 454, 458, 466, 469, 471, 478, 481, 482, 485, 489, 501, 502, 505, 511, 514, 519, 526, 529, 537, 538, 542, 543, 545, 553, 554, 561
Offset: 1

Views

Author

David W. Wilson, Jun 10 2005

Keywords

Comments

All terms except for the last term, 561, are semiprimes (A001358). Semiprimes up to 559 that are not here: 35, 55, 77, 95, 115, 119, 143, 155, 161, 187, 203, 209, 215, 221, 235, 247, 253, 287, 295, 299, 319, 323, 329, 335, 355, 371, 377, 391, 395, 403, 407, 413, 415, 437, 473, 493, 497, 515, 517, 527, 533, 535, 551, 559. - Zak Seidov, Jan 08 2015
The LCM of all terms is 23# * 277# (where # denotes the primorial function A034386), the period of A000790, and therefore also of the related sequence b(n) = gcd(A000790(n), n). - M. F. Hasler, Feb 16 2018
Range of A295997. - Thomas Ordowski, Feb 27 2018
These numbers k < 561 are semiprimes k = pq such that p-1 | q-1, where primes p <= q. Equivalent condition is p-1 | k-1. - Thomas Ordowski, Aug 18 2018
This shows that all even semiprimes < 561 are in this sequence. The odd semiprimes not in this sequence are the semiprimes (equivalently: all terms but 275, 455, 475, 539) less than 561 in A267999 (which equals A121707 up to 695). - M. F. Hasler, Nov 09 2018

Crossrefs

Programs

  • Mathematica
    pp[n_] := For[c = 4, True, c = If[PrimeQ[c+1], c+2, c+1], If[PowerMod[n, c, c] == Mod[n, c], Return[c]]];seq[n_] := seq[n] = Table[pp[k], {k, 0, 2^n}] // Union; seq[10]; seq[n = 11]; While[ Print["n = ", n, " more terms: ", Complement[seq[n], seq[n-1]]]; seq[n] != seq[n-1], n++]; A108574 = seq[n] (* Jean-François Alcover, Oct 18 2013 *)
  • PARI
    my(A=List(561)); forprime(q=2,561\2, forprime(p=2,min(q,561\q), (q-1)%(p-1)|| listput(A, p*q))); A108574=Set(A) \\ M. F. Hasler, Nov 09 2018

A326610 Least k such that A000790(k) = A108574(n).

Original entry on oeis.org

0, 3, 26, 11, 14, 59, 83, 23, 443, 338, 263, 578, 38, 662, 47, 227, 3467, 1823, 842, 4898, 983, 4622, 4847, 2747, 4127, 11567, 347, 542, 17483, 2867, 22367, 43067, 18527, 5042, 5063, 12422, 66047, 2858, 87302, 11702, 11147, 3062, 24602, 158, 94763, 247838, 1202
Offset: 1

Views

Author

Richard N. Smith, Jul 14 2019

Keywords

Comments

The largest term is a(106) = 10009487 (for the primary pretender 453).

Crossrefs

A090086 Smallest pseudoprime to base n, not necessarily exceeding n (cf. A007535).

Original entry on oeis.org

4, 341, 91, 15, 4, 35, 6, 9, 4, 9, 10, 65, 4, 15, 14, 15, 4, 25, 6, 21, 4, 21, 22, 25, 4, 9, 26, 9, 4, 49, 6, 25, 4, 15, 9, 35, 4, 39, 38, 39, 4, 205, 6, 9, 4, 9, 46, 49, 4, 21, 10, 51, 4, 55, 6, 15, 4, 57, 15, 341, 4, 9, 62, 9, 4, 65, 6, 25, 4, 69, 9, 85, 4, 15, 74, 15, 4, 77, 6, 9, 4, 9, 21, 85, 4, 15, 86, 87, 4, 91, 6
Offset: 1

Views

Author

Labos Elemer, Nov 25 2003

Keywords

Comments

If n-1 is composite, then a(n) < n. - Thomas Ordowski, Aug 08 2018
Conjecture: a(n) = A007535(n) for finitely many n. For n > 2; if a(n) > n, then n-1 is prime (find all these primes). - Thomas Ordowski, Aug 09 2018
It seems that if a(2^p) = p^2, then 2^p-1 is prime. - Thomas Ordowski, Aug 10 2018
a(n) is the smallest composite k such that n^(k-1) == (1-k)^n (mod k). - Thomas Ordowski, Mar 19 2025

Examples

			From _Robert G. Wilson v_, Feb 26 2015: (Start)
a(n) = 4 for n = 1 + 4*k, k >= 0.
a(n) = 6 for n = 7 + 12*k, k >= 0.
a(n) = 9 for n = 8 + 18*k, 10 + 18*k, 35 + 36*k, k >= 0.
(End)
a(n) = 10 for n = 51 + 60*k, 11 + 180*k, 131 + 180*k, k >= 0.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1}, While[ GCD[n, k] > 1 || PrimeQ[k] || PowerMod[n, k - 1, k] != 1, j = k++]; k]; Array[f, 91] (* Robert G. Wilson v, Feb 26 2015 *)
  • PARI
    /* a(n) <= 2000 is sufficient up to n = 10000 */
    a(n) = for(k=2,2000,if((n^(k-1))%k==1 && !isprime(k), return(k))) \\ Eric Chen, Feb 22 2015
    
  • PARI
    a(n) = {forcomposite(k=2, , if (Mod(n,k)^(k-1) == 1, return (k)););} \\ Michel Marcus, Mar 02 2015

Formula

a(n) = LeastComposite{x; n^(x-1) mod x = 1}.

A317058 a(n) is the smallest composite k such that 1^(k-1) + 2^(k-1) + ... + n^(k-1) == n (mod k).

Original entry on oeis.org

4, 341, 473, 4, 4, 133, 497, 4, 4, 15, 9, 4, 4, 143, 35, 4, 4, 51, 57, 4, 4, 77, 253, 4, 4, 65, 9, 4, 4, 115, 155, 4, 4, 187, 35, 4, 4, 9, 247, 4, 4, 287, 2051, 4, 4, 15, 33, 4, 4, 35, 85, 4, 4, 9, 9, 4, 4, 551, 1711, 4, 4, 713, 21, 4, 4, 55, 77, 4, 4, 35, 35, 4
Offset: 1

Views

Author

Thomas Ordowski, Jul 26 2018

Keywords

Comments

According to the Agoh-Giuga conjecture, a(n) <> n+1.
a(n) = 4 if and only if n == {0, 1} (mod 4).

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{k = 4}, While[PrimeQ[k] || Mod[Sum[PowerMod[j, k-1, k], {j, n}], k] != Mod[n, k], k++]; k]; Array[a, 72] (* Giovanni Resta, Jul 26 2018 *)
  • PARI
    a(n) = forcomposite(k=1,, if (sum(j=1,n, Mod(j,k)^(k-1)) == n, return (k));); \\ Michel Marcus, Jul 26 2018
    
  • Python
    from sympy import isprime
    def g(n,p,q): # compute (-n + sum_{k=1,n} k^p)  mod q
        c = (-n) % q
        for k in range(1,n+1):
            c = (c+pow(k,p,q)) % q
        return c
    def A317058(n):
        k = 2
        while isprime(k) or g(n,k-1,k):
            k += 1
        return k # Chai Wah Wu, Jul 30 2018

Extensions

More terms from Giovanni Resta, Jul 26 2018

A295997 Least composite k such that d^k == d (mod k) for every divisor d of n.

Original entry on oeis.org

4, 341, 6, 341, 4, 561, 6, 341, 6, 561, 10, 561, 4, 561, 561, 341, 4, 561, 6, 561, 6, 561, 22, 561, 4, 561, 6, 561, 4, 561, 6, 341, 561, 561, 561, 561, 4, 561, 6, 561, 4, 561, 6, 561, 561, 341, 46, 561, 6, 561, 91, 561, 4, 561, 10, 561, 6, 341, 15, 561, 4, 341
Offset: 1

Views

Author

Thomas Ordowski, Feb 14 2018

Keywords

Comments

a(n) is the smallest weak pseudoprime k to all natural bases d|n.
For n > 1, a(n) is the smallest composite k such that p^k == p (mod k) for every prime p dividing n; so a(n) is the smallest weak pseudoprime k to all prime bases p|n (thus it is enough to check this congruence only for all prime divisors p of n, see the second program in PARI).
For n > 1, a(n) = 4 iff n has all prime divisors p == 1 (mod 4).
The sequence is bounded, namely 4 <= a(n) <= 561, see A002997.
All members of A108574 appear in the sequence. The last to appear is 538 = a(8110351). - Robert Israel, Feb 15 2018
Conjecture: all distinct terms of the sequence are A108574. - Robert Israel and Thomas Ordowski, Feb 16 2018. The conjecture is true and can be established computationally, like in Conway-Guy-Schneeberger-Sloane (1997) paper. - Max Alekseyev, Feb 27 2018
Note that a(n) >= A000790(n). - Thomas Ordowski, Feb 16 2018
The sequence is not eventually periodic: e.g., any arithmetic progression contains infinitely many terms divisible by a prime == 3 (mod 4), and thus with a(n) > 4, while on the other hand there are infinitely many terms with a(n) = 4. - Robert Israel, Feb 16 2018

Crossrefs

Programs

  • Maple
    f := n -> g(map(t -> t[1], ifactors(n)[2])):
    g:= proc (P) local k; option remember;
      for k from 4 do
        if not isprime(k) and andmap(p -> (p &^ k - p mod k = 0), P)
        then return k
        end if
      end do
    end proc:
    map(f, [$1..100]); # Robert Israel, Feb 14 2018
  • Mathematica
    With[{c = Table[FixedPoint[n + PrimePi@ # + 1 &, n + PrimePi@ n + 1], {n, 561}]}, Table[With[{d = Divisors@ n}, SelectFirst[c, Function[k, AllTrue[d, PowerMod[#, k, k] == Mod[#, k] &]]]], {n, 62}]] (* Michael De Vlieger, Feb 17 2018, after Robert G. Wilson v at A066277 *)
  • PARI
    a(n) = forcomposite(k=1,, my (ok=1); fordiv (n, d, if (Mod(d,k)!=Mod(d,k)^k, ok=0; break)); if (ok, return (k))); \\ Rémy Sigrist, Feb 14 2018
    
  • PARI
    a(n)=my(f=factor(n)[,1],p); forcomposite(k=4,561, for(i=1,#f, p=f[i]; if(Mod(p,k)^k!=p, next(2))); return(k)); \\ Charles R Greathouse IV, Feb 14 2018

Formula

a(n) = a(rad(n)), where rad(n) = A007947(n).
For prime p, a(p) = A000790(p). - Max Alekseyev, Feb 27 2018

Extensions

More terms from Rémy Sigrist, Feb 14 2018

A309316 Euler primary pretenders: a(n) is the smallest odd composite k such that n^((k+1)/2) == +-n (mod k).

Original entry on oeis.org

9, 9, 341, 121, 341, 15, 15, 21, 9, 9, 9, 33, 33, 21, 15, 15, 15, 9, 9, 9, 15, 15, 21, 33, 15, 15, 9, 9, 9, 15, 15, 15, 25, 33, 21, 9, 9, 9, 39, 15, 15, 21, 21, 21, 9, 9, 9, 65, 21, 21, 15, 15, 39, 9, 9, 9, 21, 21, 57, 15, 15, 15, 9, 9, 9, 15, 15, 33, 25, 15, 15, 9, 9, 9, 15, 15, 15, 21, 21, 39, 9, 9, 9
Offset: 0

Views

Author

Thomas Ordowski, Jul 23 2019

Keywords

Comments

Note that if p is an odd prime, then n^((p+1)/2) == +-n (mod p) for all n.
a(n) is the least Euler weak pseudoprime to base n, as A000790(n) is the least Fermat weak pseudoprime to base n.
This sequence is bounded, namely a(n) <= 1729, the smallest absolute Euler pseudoprime, because n^((1729+1)/2) == n (mod 1729) for every n, see A033181.
The set A = {a(n)} of terms contains all odd semiprimes pq < 1729 such that p-1 | q-1. Other numbers in the set are 561, 645, 1065, 1247, and 1729. Probably complete. Cf. A108574.
This sequence is periodic with a very long period P = LCM(A) = p#*q#/2^2, where p and q are the largest primes such that p^2 < 1729 and 3q < 1729. Such primes are p = 41 and q = 571, so the period P = 41#*571#/4 (248 digits) is much longer than period of the (Fermat) primary pretenders.
Problem: is P the fundamental period of this sequence?
Records of a(n) are 9, 341, 561, 703, 793, 1145, 1263, 1477, and 1729; for n = 0, 2, 383, 1822, 3308, 4702, 10103, 12252, and 21821. - Amiram Eldar, Jul 24 2019

Examples

			a(2) = 341 since 2^((341+1)/2) = 2^171 == 2 (mod 341) and 341 is the smallest odd composite number satisfying this congruence.
a(5) = 15 since 5^((15+1)/2) = 5^8 == -5 (mod 15) and 15 is the smallest odd composite number with this property.
a(8) = 9 since 8^((9+1)/2) = 8^5 == 8 (mod 9) and 9 is the smallest odd composite number.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k,r;
      for k from 9 by 2 do
        if isprime(k) then next fi;
        r:= n &^ ((k+1)/2) mod k;
        if r = (n mod k) or r = (-n mod k) then return k fi
      od
    end proc:
    map(f, [$0..100]); # Robert Israel, Jul 23 2019
  • Mathematica
    a[n_] := Module[{k=9}, While[!CompositeQ[k] || ((m = PowerMod[n, (k+1)/2, k]) != Mod[n, k] && m != Mod[-n, k]), k+=2]; k]; Array[a, 100, 0] (* Amiram Eldar, Jul 23 2019 *)

Formula

a(n) = 9 if and only if n == {-1,0,1} (mod 9).
a(n + P) = a(n), where the period P = 41#*571#/4.

Extensions

More terms from Amiram Eldar, Jul 23 2019

A239293 Smallest composite c > n such that n^c == n (mod c).

Original entry on oeis.org

4, 341, 6, 6, 10, 10, 14, 9, 12, 15, 15, 22, 21, 15, 21, 20, 34, 25, 38, 21, 28, 33, 33, 25, 28, 27, 39, 36, 35, 49, 49, 33, 44, 35, 45, 42, 45, 39, 57, 52, 82, 66, 77, 45, 55, 69, 65, 49, 56, 51, 65, 65, 65, 55, 63, 57, 65, 66, 87, 65, 91, 63, 93, 65, 70, 78, 85
Offset: 1

Views

Author

Robert FERREOL, Mar 14 2014

Keywords

Comments

a(n) is the smallest weak pseudoprime to base n that is > n.
If n is even and n+1 is composite, then a(n) = n+1. [Corrected by Thomas Ordowski, Aug 03 2018]
Conjecture: a(n) = n+1 if and only if n+1 is an odd composite number. - Thomas Ordowski, Aug 03 2018

Crossrefs

Cf. A000790 (primary pretenders), A007535 (smallest pseudoprimes to base n).
Cf. A002808.

Programs

  • Haskell
    import Math.NumberTheory.Moduli (powerMod)
    a239293 n = head [c | c <- a002808_list, powerMod n c c == n]
    -- Reinhard Zumkeller, Jul 11 2014
    
  • Maple
    L:=NULL: for a to 100 do for n from a+1 while isprime(n) or not(a^n - a mod n =0) do od; L:=L,n od: L;
  • Mathematica
    Table[k = n; While[k++; PrimeQ[k] || PowerMod[n, k, k] != n]; k, {n, 100}] (* T. D. Noe, Mar 17 2014 *)
  • PARI
    a(n) = forcomposite(c=n+1, , if(Mod(n, c)^c==n, return(c))) \\ Felix Fröhlich, Aug 03 2018

A298908 Smallest composite k such that (n^k - 1)/(n - 1) == 1 (mod k) for n > 1.

Original entry on oeis.org

341, 91, 4, 15, 6, 25, 4, 9, 10, 33, 4, 65, 14, 15, 4, 9, 6, 49, 4, 21, 22, 69, 4, 25, 9, 9, 4, 15, 6, 49, 4, 33, 34, 9, 4, 133, 38, 15, 4, 21, 6, 25, 4, 9, 46, 65, 4, 25, 10, 39, 4, 9, 6, 35, 4, 25, 58, 15, 4, 91, 9, 9, 4, 15, 6, 49, 4, 15, 10, 9, 4, 65, 15, 15, 4, 21, 6, 49, 4, 9
Offset: 2

Views

Author

Keywords

Comments

The smallest repunit pseudoprime to base n.
a(n) is the smallest composite k such that n^k == n (mod (n-1)k).
a(n) is the smallest composite k such that (n^k - 1)/(n - 1) is a Fermat pseudoprime to base n.
a(n) >= A000790(n).
a(n) <= A271801(n).
a(m!+1) > m.
a(4m) = 4.
Records: 341, 361, 403, 561, 685, 1247, 1387, 1891, 2353, 2701, 3277, 4681, 5173, 5461, 6001, 6541, 7445, ..., .
If n is composite, then a(n) <= n. There are only finitely many primes p such that a(p) > p. It seems that a(n) < n for all sufficiently large n. - Thomas Ordowski, Sep 10 2018

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 4}, While[PrimeQ@k || Mod[(n^k -1)/(n -1), k] != 1, k++]; k]; Array[f, 80, 2]
    With[{r = Select[Range[4, 400], CompositeQ]}, Table[SelectFirst[r, Mod[(n^# - 1)/(n - 1), #] == 1 &], {n, 2, 81}]] (* Michael De Vlieger, Jan 28 2018 *)

A321575 Nexus primary pretenders: a(n) is the smallest composite k such that n^k - (n-1)^k == 1 (mod k).

Original entry on oeis.org

9, 4, 341, 4, 6, 4, 9, 4, 14, 4, 6, 4, 9, 4, 21, 4, 6, 4, 9, 4, 15, 4, 6, 4, 9, 4, 10, 4, 6, 4, 9, 4, 62, 4, 6, 4, 9, 4, 49, 4, 6, 4, 9, 4, 33, 4, 6, 4, 9, 4, 14, 4, 6, 4, 9, 4, 10, 4, 6, 4, 9, 4, 65, 4, 6, 4, 9, 4, 49, 4, 6, 4, 9, 4, 111, 4, 6, 4, 9, 4, 15
Offset: 0

Views

Author

Thomas Ordowski, Nov 13 2018

Keywords

Comments

The sequence is bounded, namely a(n) <= 561 (the smallest Carmichael number), since if n^k == n (mod k) and (n-1)^k == n-1 (mod k), then n^k - (n-1)^k == 1 (mod k).
Problem: find all distinct terms of the sequence. Is this sequence periodic like the primary pretenders?
Note that a(n) > 9 if and only if n == 2 (mod 6). We have a(6m+2) = 341, 14, 21, 15, 10, 62, 49, 33, 14, 10, 65, 49, 111, 15, 10, ... for m >= 0. Found a(n) = 561 for the smallest n = 6*70+2 = 422.
From Robert Israel, Nov 27 2018: (Start)
Since a(n) depends only on the residues of n mod k for composites k <= 561, it must be periodic with period at most the lcm of those composites.
Up to n=2*10^6, the last term to appear for the first time is 478 = a(184748).
Conjecture: the only terms of the sequence that are not squarefree are 4, 9 and 49. (End)

Crossrefs

Programs

  • Maple
    Comps:= remove(isprime, [$4..561]):
    f:= proc(n) local k;
      for k in Comps do if n&^k - (n-1)&^k - 1 mod k = 0 then return k fi od
    end proc:
    map(f, [$0..100]); # Robert Israel, Nov 27 2018
  • Mathematica
    a[n_]:=Module[{k=4}, While[PrimeQ[k] || Mod[n^k-(n-1)^k,k]!=1, k++]; k]; Array[a, 100, 0] (* Amiram Eldar, Nov 13 2018 *)
  • PARI
    a(n)=forcomposite(k=4,,Mod(n,k)^k-Mod(n-1,k)^k==1&&return(k)) \\ M. F. Hasler, Nov 13 2018

Formula

a(n) = 4 iff n == 1,3,5 (mod 6), thus n is odd.
a(n) = 6 iff n == 4 (mod 6).
a(n) = 9 iff n == 0 (mod 6).

Extensions

More terms from Amiram Eldar, Nov 13 2018

A340749 Fermat weak pseudoprimes k to a base d, where d | k and 1 < d < k.

Original entry on oeis.org

6, 10, 12, 14, 15, 18, 20, 21, 22, 26, 28, 30, 33, 34, 36, 38, 39, 42, 45, 46, 48, 50, 51, 52, 54, 55, 56, 57, 58, 62, 65, 66, 68, 69, 70, 72, 74, 75, 78, 80, 82, 84, 85, 86, 87, 90, 91, 93, 94, 95, 98, 100, 102, 105, 106, 110, 111, 112, 114, 116, 118, 120, 122
Offset: 1

Views

Author

Thomas Ordowski, Jan 19 2021

Keywords

Comments

Numbers k such that d^k == d (mod k) for some d with d|k and 1 < d < k.
Problem: what is the asymptotic density of the set of these numbers?
It seems that this sequence has an asymptotic density of 0.626... - Amiram Eldar, Jan 19 2021

Examples

			The number 6 is a term, because 6 | 3^6 - 3, wherein 3 | 6 and 1 < 3 < 6.
		

Crossrefs

Cf. A000790.

Programs

  • Mathematica
    q[n_] := CompositeQ[n] && AnyTrue[Rest @ Most @ Divisors[n], PowerMod[#, n, n] == # &]; Select[Range[120], q] (* Amiram Eldar, Jan 19 2021 *)
  • PARI
    isok(k) = fordiv(k, d, if ((d>1) && (dMichel Marcus, Jan 21 2021
Showing 1-10 of 11 results. Next