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

A124241 Terms of A068563 that are not terms of A124240.

Original entry on oeis.org

136, 408, 620, 680, 820, 1224, 1240, 1314, 2040, 2312, 2460, 2480, 2628, 2856, 3100, 3400, 3672, 3924, 3942, 4100, 4112, 4656, 4960, 5304, 5334, 5784, 6120, 6200, 6820, 6936, 7380, 7480, 7848, 7884, 8224, 8568, 9020, 9060, 9198, 9492, 9920, 10200, 10668, 11016, 11560, 11568, 11826, 12300, 12336, 12400, 13140, 13640
Offset: 1

Views

Author

Alexander Adamchuk, Oct 22 2006, Oct 27 2006

Keywords

Comments

A068563 contains A124240 as a subsequence. This sequence gives their set difference.
Note that a(2) = 3*a(1) and a(4) = 5*a(1). a(6) = 1224 = 9*a(1), a(7) = 1240 = 2*a(3), a(8) = 1314, a(9) = 2040 = 15*a(1), a(10) = 2312 = 17*a(1), a(11) = 2460 = 3*a(5), a(12)= 2480 = 4*a(3), a(13) = 2856 = 21*a(1). Numbers k such that there exists a(n) = k*a(1) are k = {1, 3, 5, 9, 15, 17, 21, ...}.
Many but not all terms belong to A124276.

Crossrefs

Programs

  • PARI
    for(n=1,10^5, m=n\2^valuation(n,2); if( Mod(n,znorder(Mod(2,m))), next); p=factor(n)[,1]; g=1; for(i=1,#p, if( Mod(n,p[i]-1), g=0; break) ); if(g,next); print1(n,", ") ) /* Alekseyev */

Extensions

a(13) corrected and terms a(14) onward provided by Max Alekseyev, Aug 25 2013

A289257 Terms k of A006521 such that 2*k is a term of A124240.

Original entry on oeis.org

1, 3, 9, 27, 81, 171, 243, 513, 729, 1539, 2187, 3249, 4617, 6561, 9747, 13203, 13851, 19683, 29241, 39609, 41553, 59049, 61731, 87723, 118827, 124659, 177147, 185193, 250857, 263169, 356481, 373977, 531441, 555579, 752571, 789507, 1063611, 1069443, 1121931, 1172889, 1594323, 1666737
Offset: 1

Views

Author

Michel Marcus, Jun 29 2017

Keywords

Comments

Novák numbers n that are 2n Novák-Carmichael. See Kalmynin link.

Crossrefs

Programs

  • Mathematica
    Reap[Do[If[PowerMod[2, n, n]+1 == n && Divisible[2n, CarmichaelLambda[2n]], Print[n]; Sow[n]], {n, 2 10^6}]][[2, 1]] (* Jean-François Alcover, Sep 25 2018 *)
  • PARI
    isnov(n) = Mod(2, n)^n==-1; \\ A006521
    isnovcar(n) = n%lcm(znstar(n)[2])==0; \\ A124240
    isok(n) = isnov(n) && isnovcar(2*n);
    
  • Python
    from itertools import count, islice
    from sympy.ntheory.factor_ import reduced_totient
    def A289257gen(): return filter(lambda n:2*n % reduced_totient(2*n) == 0 and pow(2,n,n)==n-1, count(1))
    A289257_list = list(islice(A289257gen(),20)) # Chai Wah Wu, Dec 11 2021

A014117 Numbers n such that m^(n+1) == m (mod n) holds for all m.

Original entry on oeis.org

1, 2, 6, 42, 1806
Offset: 1

Views

Author

Keywords

Comments

"Somebody incorrectly remembered Fermat's little theorem as saying that the congruence a^{n+1} = a (mod n) holds for all a if n is prime" (Zagier). The sequence gives the set of integers n for which this property is in fact true.
If i == j (mod n), then m^i == m^j (mod n) for all m. The latter congruence generally holds for any (m, n)=1 with i == j (mod k), k being the order of m modulo n, i.e., the least power k for which m^k == 1 (mod n). - Lekraj Beedassy, Jul 04 2002
Also, numbers n such that n divides denominator of the n-th Bernoulli number B(n) (cf. A106741). Also, numbers n such that 1^n + 2^n + 3^n + ... + n^n == 1 (mod n). Equivalently, numbers n such that B(n)*n == 1 (mod n). Equivalently, Sum_{prime p, (p-1) divides n} n/p == -1 (mod n). It is easy to see that for n > 1, n must be an even squarefree number. Moreover, the set P of prime divisors of all such n satisfies the property: if p is in P, then p-1 is the product of distinct elements of P. This set is P = {2, 3, 7, 43}, implying that the sequence is finite and complete. - Max Alekseyev, Aug 25 2013
In 2005, B. C. Kellner proved E. W. Weisstein's conjecture that denom(B_n) = n only if n = 1806. - Jonathan Sondow, Oct 14 2013
Squarefree numbers n such that b^n == 1 (mod n^2) for every b coprime to n. Squarefree terms of A341858. - Thomas Ordowski, Aug 05 2024
Conjecture: Numbers n such that gcd(d+1, n) > 1 for every proper divisor d of n. Verified up to 10^696. - David Radcliffe, May 29 2025

Crossrefs

Squarefree terms of A124240. - Robert Israel and Thomas Ordowski, Jun 23 2017

Programs

  • Mathematica
    r[n_] := Reduce[ Mod[m^(n+1) - m, n] == 0, m, Integers]; ok[n_] := Range[n]-1 === Simplify[ Mod[ Flatten[ m /. {ToRules[ r[n][[2]] ]}], n], Element[C[1], Integers]]; ok[1] = True; A014117 = {}; Do[ If[ok[n], Print[n]; AppendTo[ A014117, n] ], {n, 1, 2000}] (* Jean-François Alcover, Dec 21 2011 *)
    Select[Range@ 2000, Function[n, Times @@ Boole@ Map[Function[m, PowerMod[m, n + 1, n] == Mod[m, n]], Range@ n] > 0]] (* Michael De Vlieger, Dec 30 2016 *)
  • Python
    [n for n in range(1, 2000) if all(pow(m, n+1, n) == m for m in range(n))] # David Radcliffe, May 29 2025

Formula

For n <= 5, a(n) = a(n-1)^2 + a(n-1) with a(0) = 1. - Raphie Frank, Nov 12 2012
a(n+1) = A007018(n) = A054377(n) = A100016(n) for n = 1, 2, 3, 4. - Jonathan Sondow, Oct 01 2013

A055744 Numbers k such that k and phi(k) have the same prime factors.

Original entry on oeis.org

1, 4, 8, 16, 18, 32, 36, 50, 54, 64, 72, 100, 108, 128, 144, 162, 200, 216, 250, 256, 288, 294, 324, 400, 432, 450, 486, 500, 512, 576, 578, 588, 648, 800, 864, 882, 900, 972, 1000, 1014, 1024, 1152, 1156, 1176, 1210, 1250, 1296, 1350, 1458, 1600, 1728, 1764
Offset: 1

Views

Author

Labos Elemer, Jul 11 2000

Keywords

Comments

Contains products of suitable powers of 2 and Fermat primes. For x = 2^u*3^w, phi(x) = 2^u*3^(w-1) with suitable exponents. Analogous constructions are possible with {2,3,7} prime divisors, etc.
From Ivan Neretin, Mar 19 2015: (Start)
Also, numbers k that meet the following criteria for every prime p dividing k:
1. All prime divisors of p-1 must also divide k;
2. If k has no prime divisors of the form m*p+1, and k is divisible by p, then k must be divisible by p^2.
Also, numbers k for which {k, phi(k), phi(phi(k))} is a geometric progression.
(End)
All terms > 1 are even. An even number k is in the sequence iff 2*k is in the sequence. - Robert Israel, Mar 19 2015
For n > 1, the largest prime factor of a(n) has multiplicity >= 2. For all prime factors more than half of the largest prime factor of a(n), the multiplicity differs from 1.
If k = p1^a1 * p2^a2 * ... * pm^am is in the sequence, then so is p1^b1 * p2^b2 * ... * pm^bm for 1 <= i <= m and prime pi and bi >= ai.
If m * p^2 is not in the sequence, for a prime p and some m > 0, then neither is m * p^3. - David A. Corneth, Mar 22 2015
A027748(a(n),j) = A027748(A000010(a(n)),j) for j=1..A001221(a(n)); also numbers k such that k and phi(k) have the same squarefree kernel: A007947(a(n)) = A007947(A000010(a(n))). - Reinhard Zumkeller, Jun 01 2015
Pollack and Pomerance call these numbers "phi-perfect numbers". - Amiram Eldar, Jun 02 2020

Examples

			k = 578 = 2*17*17, phi(578) = 272 = 2*2*2*2*17 with 2 and 17 prime factors, so 578 is a term.
k = 588 = 2*2*3*7*7, phi(588) = 168 = 2*2*2*3*7, so 588 is a term.
k = 264196 = 2*2*257*257, phi(264196) = 512*257 = 131584, so 264196 is a term.
		

Crossrefs

Intersection of A073539 and A151999. - Amiram Eldar, Jun 02 2020
Cf. A007947, A027748, A055742, A173557, A256248, subsequence of A124240.

Programs

  • Haskell
    a055744 n = a055744_list !! (n-1)
    a055744_list = 1 : filter f [2..] where
       f x = all ((== 0) . mod x) (concatMap (a027748_row . subtract 1) ps) &&
             all ((== 0) . mod (a173557 x))
                 (map fst $ filter ((== 1) . snd) $ zip ps $ a124010_row x)
             where ps = a027748_row x
    -- Reinhard Zumkeller, Jun 01 2015
  • Maple
    select(numtheory:-factorset = numtheory:-factorset @ numtheory:-phi,
    [1, 2*i $ i=1..2000]); # Robert Israel, Mar 19 2015
    isA055744 := proc(n)
        nfs := numtheory[factorset](n) ;
        phinfs := numtheory[factorset](numtheory[phi](n)) ;
        if nfs = phinfs then
            true;
        else
            false;
        end if;
    end proc:
    A055744 := proc(n)
        if n = 1 then
            1;
        else
            for a from procname(n-1)+1 do
                if isA055744(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Sep 23 2016
  • Mathematica
    Select[Range@ 1800,
    First /@ FactorInteger@ # == First /@ FactorInteger@ EulerPhi@ # &] (* Michael De Vlieger, Mar 21 2015 *)
  • PARI
    is(n)=factor(n)[,1]==factor(eulerphi(n))[,1] \\ Charles R Greathouse IV, Oct 31 2011
    
  • PARI
    is(n)=my(f=factor(n)); f[,1]==factor(eulerphi(f))[,1] \\ Charles R Greathouse IV, May 26 2015
    

Extensions

Corrected and extended by James Sellers, Jul 11 2000

A174824 a(n) = period of the sequence {m^m, m >= 1} modulo n.

Original entry on oeis.org

1, 2, 6, 4, 20, 6, 42, 8, 18, 20, 110, 12, 156, 42, 60, 16, 272, 18, 342, 20, 42, 110, 506, 24, 100, 156, 54, 84, 812, 60, 930, 32, 330, 272, 420, 36, 1332, 342, 156, 40, 1640, 42, 1806, 220, 180, 506, 2162, 48, 294, 100, 816, 156, 2756, 54, 220, 168, 342
Offset: 1

Views

Author

Keywords

Comments

This is a divisibility sequence: if n divides m, a(n) divides a(m).
We have the equality n = a(n) for numbers n in A124240, which is related to Carmichael's function (A002322). The largest values of a(n) occur when n is prime, in which case a(n) = n*(n-1). - T. D. Noe, Feb 21 2014

Examples

			For n=3, 1^1 == 1 (mod 3), 2^2 == 1 (mod 3), 3^3 == 0 (mod 3), etc. The sequence of residues 1, 1, 0, 1, 2, 0, 1, 1, 0, ... has period 6, so a(3) = 6. - _Michael B. Porter_, Mar 13 2018
		

Crossrefs

Programs

  • Mathematica
    Table[LCM[n, CarmichaelLambda[n]], {n, 100}] (* T. D. Noe, Feb 20 2014 *)
  • PARI
    a(n)=local(ps);ps=factor(n)[,1]~;for(k=1,#ps,n=lcm(n,ps[k]-1));n
    
  • PARI
    a(n) = lcm(n, lcm(znstar(n)[2])); \\ Michel Marcus, Mar 18 2016; corrected by Michel Marcus, Nov 13 2019
    
  • PARI
    apply( {A174824(n)=lcm(lcm([p-1|p<-factor(n)[,1]]),n)}, [1..99]) \\ [...] = znstar(n)[2], but 3x faster. - M. F. Hasler, Nov 13 2019

Formula

a(n) = lcm(n, A173614(n)) = lcm(n, A002322(n)) = lcm(n, A011773(n)).
If n and m are relatively prime, a(n*m) = lcm(a(n), a(m)); a(p^k) = (p-1)*p^k for p prime and k > 0.
a(n) = n*A268336(n). - M. F. Hasler, Nov 13 2019

A226960 Numbers n such that 1^n + 2^n + 3^n +...+ n^n == 2 (mod n).

Original entry on oeis.org

1, 4, 12, 84, 3612
Offset: 1

Views

Author

Keywords

Comments

Also, numbers n such that B(n)*n == 2 (mod n), where B(n) is the n-th Bernoulli number. Equivalently, SUM[prime p, (p-1) divides n] n/p == -2 (mod n). - Max Alekseyev, Aug 25 2013

Crossrefs

Subsequence of A124240.
Solutions to 1^n+2^n+...+n^n == m (mod n): A005408 (m=0), A014117 (m=1), this sequence (m=2), A226961 (m=3), A226962 (m=4), A226963 (m=5), A226964 (m=6), A226965 (m=7), A226966 (m=8), A226967 (m=9), A280041 (m=19), A280043 (m=43), A302343 (m=79), A302344 (m=193).

Programs

  • Mathematica
    Select[Range[10000], Mod[Sum[PowerMod[i, #, #], {i, #}], #] == 2 &]
  • PARI
    is(n)=if(n%2,return(n==1)); Mod(sumdiv(n/2,d, if(isprime(2*d+1), n/(2*d+1)))+n/2,n)==-2 \\ Charles R Greathouse IV, Nov 13 2013

Extensions

a(1)=1 prepended by Max Alekseyev, Aug 25 2013

A068563 Numbers k such that 2^k == 4^k (mod k).

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 16, 18, 20, 24, 32, 36, 40, 42, 48, 54, 60, 64, 72, 80, 84, 96, 100, 108, 120, 126, 128, 136, 144, 156, 160, 162, 168, 180, 192, 200, 216, 220, 240, 252, 256, 272, 288, 294, 300, 312, 320, 324, 336, 342, 360, 378, 384, 400, 408, 420, 432, 440
Offset: 1

Views

Author

Benoit Cloitre, Mar 25 2002

Keywords

Comments

If k is in the sequence then 2k is also in the sequence, but the converse is not true.
Contains A124240 as a subsequence. Their difference is given by A124241. - T. D. Noe, May 30 2003
Also, integers k such that A007733(k) divides k. Also, integers k such that for every odd prime divisor p of k, A007733(p) = A002326((p-1)/2) divides k. Also, integers k such that A000265(k) divides 2^k-1. - Max Alekseyev, Aug 25 2013

Crossrefs

Programs

  • Mathematica
    Select[Range[500], PowerMod[2,#,# ] == PowerMod[4,#,# ] & ]
  • PARI
    isok(k) = Mod(2, k)^k == Mod(4, k)^k; \\ Amiram Eldar, Apr 19 2025

Extensions

Comment and Mathematica program corrected by T. D. Noe, Oct 17 2008

A268336 a(n) = A174824(n)/n, where A174824(n) = lcm(A002322(n), n) and A002322(n) is the Carmichael lambda function (also known as the reduced totient function or the universal exponent of n).

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 6, 1, 2, 2, 10, 1, 12, 3, 4, 1, 16, 1, 18, 1, 2, 5, 22, 1, 4, 6, 2, 3, 28, 2, 30, 1, 10, 8, 12, 1, 36, 9, 4, 1, 40, 1, 42, 5, 4, 11, 46, 1, 6, 2, 16, 3, 52, 1, 4, 3, 6, 14, 58, 1, 60, 15, 2, 1, 12, 5, 66, 4, 22, 6, 70, 1, 72, 18, 4, 9, 30, 2, 78, 1, 2
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 01 2016

Keywords

Crossrefs

Programs

  • Magma
    [1] cat [Lcm(n, CarmichaelLambda(n))/n: n in [2..100]]: // Feb 03 2016
    
  • Mathematica
    Table[LCM[n, CarmichaelLambda@ n]/n, {n, 100}] (* Michael De Vlieger, Feb 03 2016, after T. D. Noe at A174824 *)
  • PARI
    a(n)=my(ps); ps=factor(n)[, 1]~; m = n; for(k=1, #ps, m=lcm(m, ps[k]-1)); m/n \\ Michel Marcus, Feb 21 2016
    
  • PARI
    apply( {A268336(n)=lcm(lcm([p-1|p<-factor(n)[,1]]),n)/n}, [1..99]) \\ [...] = znstar(n)[2], but 3x faster. - M. F. Hasler, Nov 13 2019

Formula

a(n) = A174824(n)/n.
a(A124240(n)) = 1. - Michel Marcus, Feb 21 2016

Extensions

More terms from Vincenzo Librandi, Feb 03 2016

A276976 Smallest m such that b^m == b^n (mod n) for every integer b.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 1, 4, 3, 2, 1, 2, 1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 4, 5, 2, 9, 4, 1, 2, 1, 8, 3, 2, 11, 6, 1, 2, 3, 4, 1, 6, 1, 4, 9, 2, 1, 4, 7, 10, 3, 4, 1, 18, 15, 8, 3, 2, 1, 4, 1, 2, 3, 16, 5, 6, 1, 4, 3, 10, 1, 6, 1, 2, 15, 4, 17, 6, 1, 4, 27, 2, 1
Offset: 1

Views

Author

Thomas Ordowski, Sep 23 2016

Keywords

Comments

It suffices to check all bases 0 < b < n for n > 2.
The congruence n == a(n) (mod A002322(n)) is always true.
a(n) = 1 iff n is a prime or a Carmichael number.
We have a(n) > 0 for n > 1, and a(n) <= n/2.
If n > 2 then a(n) is odd iff n is odd.
Conjecture: a(n) <= n/3 for every n >= 9.
Professor Andrzej Schinzel proved this conjecture (in a letter to the author). - Thomas Ordowski, Sep 30 2016
Note: a(n) = n/3 for n = A038754 >= 3.
Numbers n such that a(n) > A270096(n) are A290960.
Information from Carl Pomerance: a(n) > A002322(n) if and only if 8|n and n is in A050990; such n = 8, 24, 56, ... - Thomas Ordowski, Jun 21 2017
Number of integers k < n such that b^k == b^n (mod n) for every integer b is f(n) = (n - a(n))/lambda(n). For n > 1, f(n) = floor((n-1)/lambda(n)) if and only if a(n) <= lambda(n), where lambda(n) = A002322(n). - Thomas Ordowski, Jun 21 2017
a(n) >= A051903(n); numbers n such that a(n) = A051903(n) are 1, primes, Carmichael numbers, and A327295. - Thomas Ordowski, Dec 06 2019

Crossrefs

Programs

  • Mathematica
    With[{nn = 83}, Table[SelectFirst[Range[nn/4 + 10], Function[m, AllTrue[Range[2, n - 1], PowerMod[#, m , n] == PowerMod[#, n , n] &]]] - Boole[n == 1], {n, nn}]] (* Michael De Vlieger, Aug 15 2017 *)
    a[1] = 0; a[8] = a[24] = 4; a[n_] := If[(rem = Mod[n, (lam = CarmichaelLambda[n])]) >= Max @@ Last /@ FactorInteger[n], rem, rem + lam]; Array[a, 100] (* Amiram Eldar, Nov 30 2019 *)
  • PARI
    a(n)=if(n<3, return(n-1)); forstep(m=1,n,n%2+1, for(b=0,n-1, if(Mod(b,n)^m-Mod(b,n)^n, next(2))); return(m)) \\ Charles R Greathouse IV, Sep 23 2016
    
  • Python
    def a(n): return next(m for m in range(0, n+1) if all(pow(b,m,n)==pow(b,n,n) for b in range(1, 2*n+1))) # Nicholas Stefan Georgescu, Jun 03 2022

Formula

a(p) = 1 for prime p.
a(2*p) = 2 for prime p.
a(3*p) = 3 for odd prime p.
a(p^k) = p^(k-1) for odd prime p and k >= 1.
a(2*p^k) = 2*p^(k-1) for odd prime p and k >= 1.
a(2^k) = 2^(k-2) for k >= 4.
From Thomas Ordowski, Jul 09 2017: (Start)
Full description of the function:
a(n) = lambda(n) if lambda(n)|n except n = 1, 8, and 24;
a(n) = lambda(n)+2 if lambda(n)|(n-2) and 8|n;
a(n) = n mod lambda(n) otherwise;
where lambda(n) = A002322(n). (End)
For n <> 8 and 24, a(n) = A(n) if A(n) >= A051903(n) or a(n) = A002322(n) + A(n) otherwise, where A(n) = A219175(n). - Thomas Ordowski, Nov 30 2019

Extensions

More terms from Altug Alkan, Sep 23 2016

A140470 Numbers n such that p+1 divides n for every prime p that divides n.

Original entry on oeis.org

1, 12, 24, 36, 48, 60, 72, 96, 108, 120, 132, 144, 168, 180, 192, 216, 240, 264, 288, 300, 324, 336, 360, 384, 396, 432, 480, 504, 528, 540, 552, 576, 600, 612, 648, 660, 672, 720, 768, 792, 840, 864, 900, 960, 972, 1008, 1056, 1080, 1104, 1140, 1152, 1176
Offset: 1

Views

Author

Leroy Quet, Jun 28 2008

Keywords

Comments

Every term is a multiple of 12.

Crossrefs

Programs

  • Haskell
    a140470 n = a140470_list !! (n-1)
    a140470_list = filter
       (\x -> all (== 0) $ map ((mod x) . (+ 1)) $ a027748_row x) [1..]
    -- Reinhard Zumkeller, Aug 27 2013
  • Mathematica
    a = {}; For[n = 2, n < 1500, n++, b = Select[Range[n], PrimeQ[ # ] && Mod[n, # ] == 0 &]; c = 1; For[d = 1, d < Length[b] + 1, d++, If[Mod[n, b[[d]] + 1] > 0, c = 0; Break]]; If[c == 1, AppendTo[a, n]]]; a (* Stefan Steinerberger, Jul 01 2008 *)
    eppQ[n_]:=Union[Differences/@Select[Partition[Divisors[n],2,1], PrimeQ[ #[[1]]]&]]=={{1}}; Join[{1},Select[Range[1200],eppQ]] (* Harvey P. Dale, May 27 2016 *)

Extensions

More terms from Stefan Steinerberger, Jul 01 2008
a(1)=1 prepended by Max Alekseyev, Aug 27 2013
Showing 1-10 of 27 results. Next