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

A002997 Carmichael numbers: composite numbers k such that a^(k-1) == 1 (mod k) for every a coprime to k.

Original entry on oeis.org

561, 1105, 1729, 2465, 2821, 6601, 8911, 10585, 15841, 29341, 41041, 46657, 52633, 62745, 63973, 75361, 101101, 115921, 126217, 162401, 172081, 188461, 252601, 278545, 294409, 314821, 334153, 340561, 399001, 410041, 449065, 488881, 512461, 530881, 552721
Offset: 1

Views

Author

Keywords

Comments

V. Šimerka found the first 7 terms of this sequence 25 years before Carmichael (see the link and also the remark of K. Conrad). - Peter Luschny, Apr 01 2019
k is composite and squarefree and for p prime, p|k => p-1|k-1.
An odd composite number k is a pseudoprime to base a iff a^(k-1) == 1 (mod k). A Carmichael number is an odd composite number k which is a pseudoprime to base a for every number a prime to k.
A composite odd number k is a Carmichael number if and only if k is squarefree and p-1 divides k-1 for every prime p dividing k. (Korselt, 1899)
Ghatage and Scott prove using Fermat's little theorem that (a+b)^k == a^k + b^k (mod k) (the freshman's dream) exactly when k is a prime (A000040) or a Carmichael number. - Jonathan Vos Post, Aug 31 2005
Alford et al. have constructed a Carmichael number with 10333229505 prime factors, and have also constructed Carmichael numbers with m prime factors for every m between 3 and 19565220. - Jonathan Vos Post, Apr 01 2012
Thomas Wright proved that for any numbers b and M in N with gcd(b,M) = 1, there are infinitely many Carmichael numbers k such that k == b (mod M). - Jonathan Vos Post, Dec 27 2012
Composite numbers k relatively prime to 1^(k-1) + 2^(k-1) + ... + (k-1)^(k-1). - Thomas Ordowski, Oct 09 2013
Composite numbers k such that A063994(k) = A000010(k). - Thomas Ordowski, Dec 17 2013
Odd composite numbers k such that k divides A002445((k-1)/2). - Robert Israel, Oct 02 2015
If k is a Carmichael number and gcd(b-1,k)=1, then (b^k-1)/(b-1) is a pseudoprime to base b by Steuerwald's theorem; see the reference in A005935. - Thomas Ordowski, Apr 17 2016
Composite numbers k such that p^k == p (mod k) for every prime p <= A285512(k). - Max Alekseyev and Thomas Ordowski, Apr 20 2017
If a composite m < A285549(n) and p^m == p (mod m) for every prime p <= prime(n), then m is a Carmichael number. - Thomas Ordowski, Apr 23 2017
The sequence of all Carmichael numbers can be defined as follows: a(1) = 561, a(n+1) = smallest composite k > a(n) such that p^k == p (mod k) for every prime p <= n+2. - Thomas Ordowski, Apr 24 2017
An integer m > 1 is a Carmichael number if and only if m is squarefree and each of its prime divisors p satisfies both s_p(m) >= p and s_p(m) == 1 (mod p-1), where s_p(m) is the sum of the base-p digits of m. Then m is odd and has at least three prime factors. For each prime factor p, the sharp bound p <= a*sqrt(m) holds with a = sqrt(17/33) = 0.7177.... See Kellner and Sondow 2019. - Bernd C. Kellner and Jonathan Sondow, Mar 03 2019
Carmichael numbers are special polygonal numbers A324973. The rank of the n-th Carmichael number is A324975(n). See Kellner and Sondow 2019. - Jonathan Sondow, Mar 26 2019
An odd composite number m is a Carmichael number iff m divides denominator(Bernoulli(m-1)). The quotient is A324977. See Pomerance, Selfridge, & Wagstaff, p. 1006, and Kellner & Sondow, section on Bernoulli numbers. - Jonathan Sondow, Mar 28 2019
This is setwise difference A324050 \ A008578. Many of the same identities apply also to A324050. - Antti Karttunen, Apr 22 2019
If k is a Carmichael number, then A309132(k) = A326690(k). The proof generalizes that of Theorem in A309132. - Jonathan Sondow, Jul 19 2019
Composite numbers k such that A111076(k)^(k-1) == 1 (mod k). Proof: the multiplicative order of A111076(k) mod k is equal to lambda(k), where lambda(k) = A002322(k), so lambda(k) divides k-1, qed. - Thomas Ordowski, Nov 14 2019
For all positive integers m, m^k - m is divisible by k, for all k > 1, iff k is either a Carmichael number or a prime, as is used in the proof by induction for Fermat's Little Theorem. Also related are A182816 and A121707. - Richard R. Forberg, Jul 18 2020
From Amiram Eldar, Dec 04 2020, Apr 21 2024: (Start)
Ore (1948) called these numbers "Numbers with the Fermat property", or, for short, "F numbers".
Also called "absolute pseudoprimes". According to Erdős (1949) this term was coined by D. H. Lehmer.
Named by Beeger (1950) after the American mathematician Robert Daniel Carmichael (1879 - 1967). (End)
For ending digit 1,3,5,7,9 through the first 10000 terms, we see 80.3, 4.1, 7.4, 3.8 and 4.3% apportionment respectively. Why the bias towards ending digit "1"? - Bill McEachen, Jul 16 2021
It seems that for any m > 1, the remainders of Carmichael numbers modulo m are biased towards 1. The number of terms congruent to 1 modulo 4, 6, 8, ..., 24 among the first 10000 terms: 9827, 9854, 8652, 8034, 9682, 5685, 6798, 7820, 7880, 3378 and 8518. - Jianing Song, Nov 08 2021
Alford, Granville and Pomerance conjectured in their 1994 paper that a statement analogous to Bertrand's Postulate could be applied to Carmichael numbers. This has now been proved by Daniel Larsen, see link below. - David James Sycamore, Jan 17 2023

References

  • N. G. W. H. Beeger, On composite numbers n for which a^n == 1 (mod n) for every a prime to n, Scripta Mathematica, Vol. 16 (1950), pp. 133-135.
  • Albert H. Beiler, Recreations in the Theory of Numbers, Dover Publications, Inc. New York, 1966, Table 18, Page 44.
  • David M. Burton, Elementary Number Theory, 5th ed., McGraw-Hill, 2002.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 142.
  • CRC Standard Mathematical Tables and Formulae, 30th ed., 1996, p. 87.
  • Richard K. Guy, Unsolved Problems in Number Theory, A13.
  • Øystein Ore, Number Theory and Its History, McGraw-Hill, 1948, Reprinted by Dover Publications, 1988, Chapter 14.
  • Paul Poulet, Tables des nombres composés vérifiant le théorème du Fermat pour le module 2 jusqu'à 100.000.000, Sphinx (Brussels), 8 (1938), 42-45.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 22, 100-103.
  • Wacław Sierpiński, A Selection of Problems in the Theory of Numbers. Macmillan, NY, 1964, p. 51.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 145-146.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See entry 561 at p. 157.

Crossrefs

Programs

  • Haskell
    a002997 n = a002997_list !! (n-1)
    a002997_list = [x | x <- a024556_list,
    all (== 0) $ map ((mod (x - 1)) . (subtract 1)) $ a027748_row x]
    -- Reinhard Zumkeller, Apr 12 2012
    
  • Magma
    [n: n in [3..53*10^4 by 2] | not IsPrime(n) and n mod CarmichaelLambda(n) eq 1]; // Bruno Berselli, Apr 23 2012
    
  • Maple
    filter:= proc(n)
      local q;
      if isprime(n) then return false fi;
      if 2 &^ (n-1) mod n <> 1 then return false fi;
      if not numtheory:-issqrfree(n) then return false fi;
      for q in numtheory:-factorset(n) do
        if (n-1) mod (q-1) <> 0 then return false fi
      od:
      true;
    end proc:
    select(filter, [seq(2*k+1,k=1..10^6)]); # Robert Israel, Dec 29 2014
    isA002997 := n -> 0 = modp(n-1, numtheory:-lambda(n)) and not isprime(n) and n <> 1:
    select(isA002997, [$1..10000]); # Peter Luschny, Jul 21 2019
  • Mathematica
    Cases[Range[1,100000,2], n_ /; Mod[n, CarmichaelLambda[n]] == 1 && ! PrimeQ[n]] (* Artur Jasinski, Apr 05 2008; minor edit from Zak Seidov, Feb 16 2011 *)
    Select[Range[1,600001,2],CompositeQ[#]&&Mod[#,CarmichaelLambda[#]]==1&] (* Harvey P. Dale, Jul 08 2023 *)
  • PARI
    Korselt(n)=my(f=factor(n));for(i=1,#f[,1],if(f[i,2]>1||(n-1)%(f[i,1]-1),return(0)));1
    isA002997(n)=n%2 && !isprime(n) && Korselt(n) && n>1 \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    is_A002997(n, F=factor(n)~)={ #F>2 && !foreach(F,f,(n%(f[1]-1)==1 && f[2]==1) || return)} \\ No need to check parity: if efficiency is needed, scan only odd numbers. - M. F. Hasler, Aug 24 2012, edited Mar 24 2022
    
  • Python
    from itertools import islice
    from sympy import nextprime, factorint
    def A002997_gen(): # generator of terms
        p, q = 3, 5
        while True:
            for n in range(p+2,q,2):
                f = factorint(n)
                if max(f.values()) == 1 and not any((n-1) % (p-1) for p in f):
                    yield n
            p, q = q, nextprime(q)
    A002997_list = list(islice(A002997_gen(),20)) # Chai Wah Wu, May 11 2022
  • Sage
    def isCarmichael(n):
        if n == 1 or is_even(n) or is_prime(n):
            return False
        factors = factor(n)
        for f in factors:
            if f[1] > 1: return False
            if (n - 1) % (f[0] - 1) != 0:
                return False
        return True
    print([n for n in (1..20000) if isCarmichael(n)]) # Peter Luschny, Apr 02 2019
    

Formula

Sum_{n>=1} 1/a(n) is in the interval (0.004706, 27.8724) (Bayless and Kinlaw, 2017). The upper bound was reduced to 0.0058 by Kinlaw (2023). - Amiram Eldar, Oct 26 2020, Feb 24 2024

Extensions

Links for lists of Carmichael numbers updated by Jan Kristian Haugland, Mar 25 2009 and Danny Rorabaugh, May 05 2017

A247074 a(n) = phi(n)/(Product_{primes p dividing n } gcd(p - 1, n - 1)).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 4, 3, 4, 1, 4, 1, 6, 2, 8, 1, 6, 1, 8, 3, 10, 1, 8, 5, 12, 9, 4, 1, 8, 1, 16, 5, 16, 6, 12, 1, 18, 6, 16, 1, 12, 1, 20, 3, 22, 1, 16, 7, 20, 8, 8, 1, 18, 10, 24, 9, 28, 1, 16, 1, 30, 9, 32, 3, 4, 1, 32, 11, 8, 1, 24, 1, 36, 10, 12, 15, 24, 1, 32, 27, 40, 1, 24, 4, 42, 14, 40, 1, 24, 2, 44, 15, 46
Offset: 1

Views

Author

Eric Chen, Nov 16 2014

Keywords

Comments

a(n) = A000010(n)/A063994(n). - Eric Chen, Nov 29 2014
Does every natural number appear in this sequence? If so, do they appear infinitely many times? - Eric Chen, Nov 26 2014
A063994(n) must be a factor of EulerPhi(n). - Eric Chen, Nov 26 2014
Number n is (Fermat) pseudoprimes (or prime) to one in a(n) of its coprime bases. That is, b^(n-1) = 1 (mod n) for one in a(n) of numbers b coprime to n. - Eric Chen, Nov 26 2014
a(n) = 1 if and only if n is 1, prime (A000040), or Carmichael number (A002997). - Eric Chen, Nov 26 2014
a(A191311(n)) = 2. - Eric Chen, Nov 26 2014
a(p^n) = p^(n-1), where p is a prime. - Eric Chen, Nov 26 2014
a(A209211(n)) = EulerPhi(A209211(n)), because A063994(A209211(n)) = 1. - Eric Chen, Nov 26 2014

Examples

			EulerPhi(15) = 8, and that 15 is a Fermat pseudoprime in base 1, 4, 11, and 14, the total is 4 bases, so a(15) = 8/4 = 2.
		

Crossrefs

Programs

  • Mathematica
    a063994[n_] := Times @@ GCD[n - 1, First /@ FactorInteger@ n - 1]; a063994[1] = 1; a247074[n_] := EulerPhi[n]/a063994[n]; Array[a247074, 150]
  • PARI
    a(n)=my(f=factor(n));eulerphi(f)/prod(i=1,#f~,gcd(f[i,1]-1,n-1)) \\ Charles R Greathouse IV, Nov 17 2014

Formula

A003557(n) <= a(n) <= n, and a(n) is a multiple of A003557(n). - Charles R Greathouse IV, Nov 17 2014

A334006 Triangle read by rows: T(n,k) = (the number of nonnegative bases m < n such that m^k == m (mod n))/(the number of nonnegative bases m < n such that -m^k == m (mod n)) for nonnegative k < n, n >= 1.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 2, 1, 3, 1, 5, 1, 1, 1, 1, 3, 1, 3, 1, 3, 1, 7, 1, 3, 1, 3, 1, 1, 4, 1, 5, 1, 5, 1, 5, 1, 9, 1, 3, 1, 3, 1, 7, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 5, 1, 11, 1, 3, 1, 3, 1, 3, 1, 3, 1, 1, 6, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 13, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 1, 7, 1, 3, 1, 3
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 12 2020

Keywords

Comments

If the sum of proper divisors of q in row q <= q, then q are 1, 2, 3, 4, 5, 8, 16, 17, 32, 64, 128, 256, 257, ...(union of Fermat primes and powers of 2).

Examples

			Triangle T(n,k) begins:
  n\k| 0   1  2  3  4   5  6  7  8   9 10 11 12  13 14 15 16
  ---+------------------------------------------------------
   1 | 1;
   2 | 1,  1;
   3 | 1,  3, 1;
   4 | 1,  2, 1, 3;
   5 | 1,  5, 1, 1, 1;
   6 | 1,  3, 1, 3, 1,  3;
   7 | 1,  7, 1, 3, 1,  3, 1;
   8 | 1,  4, 1, 5, 1,  5, 1, 5;
   9 | 1,  9, 1, 3, 1,  3, 1, 7, 1;
  10 | 1,  5, 1, 1, 1,  5, 1, 1, 1,  5;
  11 | 1, 11, 1, 3, 1,  3, 1, 3, 1,  3, 1;
  12 | 1,  6, 1, 9, 1,  9, 1, 9, 1,  9, 1, 9;
  13 | 1, 13, 1, 1, 1,  5, 1, 1, 1,  5, 1, 1, 1;
  14 | 1,  7, 1, 3, 1,  3, 1, 7, 1,  3, 1, 3, 1, 7;
  15 | 1, 15, 1, 3, 1, 15, 1, 3, 1, 15, 1, 3, 1, 15, 1;
  16 | 1,  8, 1, 5, 1,  9, 1, 5, 1,  9, 1, 5, 1,  9, 1, 5;
  17 | 1, 17, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1;
  ...
For (n, k) = (7, 3), there are three nonnegative values of m < n such that m^3 == m (mod 7) (namely 0, 1, and 6) and one nonnegative value of m < n such that -m^3 == m (mod 7) (namely 0), so T(7,3) = 3/1 = 3.
		

Crossrefs

Programs

  • Magma
    [[#[m: m in [0..n-1] | m^k mod n eq m]/#[m: m in [0..n-1] | -m^k mod n eq m]: k in [0..n-1]]: n in [1..17]];
    
  • PARI
    T(n, k) = sum(m=0, n-1, Mod(m, n)^k == m)/sum(m=0, n-1, -Mod(m, n)^k == m);
    matrix(7, 7, n, k, k--; if (k>=n, 0, T(n,k))) \\ to see the triangle \\ Michel Marcus, Apr 17 2020

Extensions

Name corrected by Peter Kagey, Sep 12 2020

A371883 a(n) is the number of divisors d of n such that d^n mod n = d.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 2, 1, 4, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 3, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 1, 1, 3, 4, 1, 2, 2, 2, 1, 2, 1, 2, 2, 1, 1, 3, 1, 2, 1, 2, 1, 3, 2, 2, 2, 1, 1, 3, 2, 1, 2, 2, 2, 1, 1, 2, 1, 2
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 10 2024

Keywords

Comments

1 <= a(n) < A000005(n) for n >= 2.

Examples

			a(1) = 0: 1 divides 1, but 1^1 mod 1 = 0 (not 1).
a(2) = 1: 1 divides 2, and 1^2 mod 2 = 1;
          2 divides 2, but 2^2 mod 2 = 0 (not 2).
a(6) = 2: 1 divides 6, and 1^6 mod 6 = 1;
          2 divides 6, but 2^6 mod 6 = 4 (not 2);
          3 divides 6, and 3^6 mod 6 = 3;
          6 divides 6, but 6^6 mod 6 = 0 (not 6).
		

Crossrefs

Programs

  • Magma
    [#[d: d in Divisors(n) | d^n mod n eq d]: n in [1..100]];
    
  • Mathematica
    a[n_] := DivisorSum[n, 1 &, PowerMod[#, n, n] == # &]; Array[a, 100] (* Amiram Eldar, Apr 11 2024 *)
  • PARI
    a(n) = sumdiv(n, d, d^n % n == d); \\ Michel Marcus, Apr 20 2024
  • Python
    from sympy import divisors
    def a(n): return sum(1 for d in divisors(n)[:-1] if pow(d, n, n) == d)
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Apr 10 2024
    

A333570 Number of nonnegative values c such that c^n == -c (mod n).

Original entry on oeis.org

1, 2, 1, 2, 1, 4, 1, 2, 1, 4, 1, 4, 1, 4, 3, 2, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 8, 1, 8, 1, 2, 1, 4, 3, 4, 1, 4, 3, 4, 1, 8, 1, 4, 1, 4, 1, 4, 1, 4, 3, 8, 1, 4, 3, 4, 1, 4, 1, 8, 1, 4, 1, 2, 1, 24, 1, 4, 1, 16, 1, 4, 1, 4, 3, 8, 1, 8, 1, 4, 1, 4, 1, 8, 5, 4, 3, 4, 1, 8, 7, 4, 1, 4, 3
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Mar 27 2020

Keywords

Comments

a(n) is the number of nonnegative bases c < n such that c^n + c == 0 (mod n).
a(2^k) = 2 for k > 0.
a(p^m) = 1 for odd prime p with m >= 0.
Let fy(n) = (the number of values b in Z/nZ such that b^y = b)/(the number of values c in Z/nZ such that -c^y = c) for nonnegative y, then:
f0(n) = A000012(n),
f1(n) = A026741(n),
f2(n) = A000012(n),
1 <= f3(n) <= n,
f4(n) = A000012(n), ...,
1 <= fn(n) = A182816(n)/a(n) <= n, where fn(n) = n for odd noncomposite numbers A006005 and Carmichael numbers A002997.

Crossrefs

Programs

  • Magma
    [#[c: c in [0..n-1] | -c^n mod n eq c]: n in [1..95]];
    
  • PARI
    a(n) = sum(c=1, n, Mod(c, n)^n == -c); \\ Michel Marcus, Mar 27 2020

Formula

a(n) = A182816(n)/r for some odd r.

A371513 a(n) is the smallest number m with n divisors d such that d^m mod m = d.

Original entry on oeis.org

1, 2, 6, 42, 30, 105, 910, 561, 1365, 5005, 5565, 11305, 36465, 140505, 239785, 41041, 682465, 873145, 185185, 418285, 1683969, 2113665, 5503785, 1242241, 6697405, 8549905, 31932901, 11996985, 31260405, 30534805, 47031061, 825265, 27265161, 32306365, 55336645, 21662641
Offset: 0

Views

Author

Juri-Stepan Gerasimov, Apr 10 2024

Keywords

Examples

			a(0) = 1 with divisors {};
a(1) = 2 with divisor {1};
a(2) = 6 with divisors {1, 3};
a(3) = 42 with divisors {1, 7, 21};
a(4) = 30 with divisors {1, 6, 10, 15};
a(5) = 105 with divisors {1, 7, 15, 21, 35};
a(6) = 910 with divisors {1, 35, 65, 91, 130, 455};
a(7) = 561 with divisors {1, 3, 11, 17, 33, 51, 187};
a(8) = 1365 with divisors {1, 13, 21, 91, 105, 195, 273, 455};
a(9) = 5005 with divisors {1, 11, 55, 65, 77, 143, 385, 715, 1001};
a(10) = 5565 with divisors {1, 7, 15, 21, 35, 105, 265, 371, 1113, 1855};
a(11) = 11305 with divisors {1, 17, 19, 35, 85, 119, 323, 595, 665, 1615, 2261}.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := DivisorSum[n, 1 &, PowerMod[#, n, n] == # &]; seq[max_] := Module[{t = Table[0, {max}], c = 0, n = 1, i}, While[c < max, i = f[n] + 1; If[i <= max && t[[i]] == 0, c++; t[[i]] = n]; n++]; t]; seq[18] (* Amiram Eldar, Apr 11 2024 *)
  • Python
    from sympy import divisors
    from itertools import count, islice
    def f(n, divs): return sum(1 for d in divs if pow(d, n, n) == d%n)
    def agen(verbose=False): # generator of terms
        adict, n = dict(), 0
        for k in count(1):
            divs = divisors(k)[1:]
            if len(divs) < n: continue
            v = f(k, divs)
            if v not in adict:
                adict[v] = k
                if verbose: print("FOUND", v, k)
            while n in adict: yield adict[n]; n += 1
    print(list(islice(agen(), 15))) # Michael S. Branicky, Apr 10 2024, updated Apr 17 2024 after Jon E. Schoenfield

Extensions

a(12)-a(25) from Michael S. Branicky, Apr 10 2024
a(26)-a(35) from Jon E. Schoenfield, Apr 10 2024

A371884 Irregular triangle read by rows in which row n >= 2 lists the divisors d of n such that d^n mod n = d.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 5, 1, 1, 4, 1, 1, 7, 1, 5, 1, 1, 1, 9, 1, 1, 5, 1, 7, 1, 11, 1, 1, 1, 1, 13, 1, 1, 4, 1, 1, 6, 10, 15, 1, 1, 1, 11, 1, 17, 1, 1, 9, 1, 1, 19, 1, 13, 1, 1, 1, 7, 21, 1, 1, 1, 9, 1, 23, 1, 1, 16, 1, 1, 25, 1, 17, 1, 13, 1, 1, 27, 1, 11, 1, 8, 1, 19, 1, 29, 1, 1, 1, 1, 31, 1, 1, 1, 5, 13
Offset: 2

Views

Author

Juri-Stepan Gerasimov, Apr 10 2024

Keywords

Examples

			Triangle begins:
    1;
    1;
    1;
    1;
    1, 3;
    1;
    1;
    1;
    1, 5;
    1;
    1, 4;
    1;
    1, 7;
    1, 5;
    1;
    1;
    1, 9;
    1;
    1, 5;
    1, 7;
    1, 11;
    1;
    1;
    1;
    1, 13;
    1;
    1, 4;
    1;
    1, 6, 10, 15;
    ...
		

Crossrefs

Programs

  • Magma
    [[d: d in Divisors(n) | d^n mod n eq d]: n in [2..65]];
  • Maple
    f:= proc(n) op(sort(convert(select(d -> d^n mod n = d, numtheory:-divisors(n)),list))) end proc:
    for n from 2 to 100 do f(n) od; # Robert Israel, May 11 2025
  • Mathematica
    row[n_] := Select[Divisors[n], PowerMod[#, n, n] == # &]; Array[row, 64, 2] // Flatten (* Amiram Eldar, Apr 11 2024 *)

A182817 Number of elements k in Z/mZ such that k^m=k, for nonprime m = A018252(n).

Original entry on oeis.org

1, 2, 4, 2, 3, 4, 4, 4, 9, 2, 4, 4, 9, 4, 4, 5, 4, 3, 8, 8, 2, 9, 4, 9, 4, 4, 9, 4, 8, 4, 15, 4, 4, 7, 4, 9, 8, 4, 9, 4, 9, 4, 8, 4, 9, 2, 25, 24, 4, 9, 16, 4, 4, 9, 8, 9, 8, 4, 3, 4, 8, 25, 4, 9, 4, 8, 49, 4, 9, 4, 9, 4, 4, 9, 4, 8, 4, 45, 4, 4, 8, 9, 8, 8, 9, 4, 15, 4, 9, 8, 11, 4, 9, 8, 5, 8, 2, 9, 16, 8, 49, 4, 9, 4, 8, 8, 9, 4, 9, 4, 25, 4, 9, 8, 8, 4, 27, 16, 9, 8, 4, 9, 4, 9, 4
Offset: 1

Views

Author

M. F. Hasler, Dec 05 2010

Keywords

Comments

This is a reduced version of A182816, without the "trivial" terms a(n)=n for prime indices n.

Crossrefs

Programs

  • Mathematica
    f[n_] := Times @@ ((1 + GCD[n-1, #-1]) & /@ FactorInteger[n][[;;,1]]); f /@ Select[Range[165], !PrimeQ[#] &] (* Amiram Eldar, Mar 27 2021 *)

Formula

a(n) = A182816(A018252(n)).

A337820 Array read by antidiagonals: T(n,k) (n >= 1, k >= 0) is the ratio (the number of nonnegative bases m < n such that m^k == m (mod n))/(the number of nonnegative bases m < n such that -m^k == m (mod n)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, 5, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 7, 1, 1, 1, 3, 1, 1, 1, 4, 1, 3, 1, 3, 1, 1, 1, 1, 9, 1, 3, 1, 5, 1, 3, 1, 1, 1, 5, 1, 5, 1, 3, 1, 3, 1, 1, 1, 1, 11, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 6, 1, 1, 1, 5, 1, 3, 1, 3, 1, 1, 1, 1, 13, 1, 3, 1, 3
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Sep 23 2020

Keywords

Comments

Array read by antidiagonals: T(n,k) (n >=1, k >= 0) is part of n of the form (the number of nonnegative bases m < n such that m^k == m (mod n))/(the number of nonnegative bases m < n such that -m^k == m (mod n)).

Examples

			The initial rows of the array are:
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, ...
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 1, 3, 3, 1, 3, 3, 5, 3, 1, 3, 9, 1, ...
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 1, 3, 3, 5, 3, 3, 5, 3, 5, 3, 9, 5, ...
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 1, 3, 3, 1, 3, 7, 5, 7, 1, 3, 9, 1, ...
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 1, 3, 3, 5, 3, 3, 5, 3, 5, 3, 9, 5, ...
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 1, 3, 3, 1, 3, 3, 5, 3, 1, 3, 9, 1, ...
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 1, 3, 3, 5, 3, 7, 5, 7, 5, 3, 9, 5, ...
The initial antidiagonals are:
     1,
     1,  1,
     1,  1, 1,
     1,  3, 1, 1,
     1,  2, 1, 1, 1,
     1,  5, 1, 3, 1, 1,
     1,  3, 1, 3, 1, 1, 1,
     1,  7, 1, 1, 1, 3, 1, 1,
     1,  4, 1, 3, 1, 3, 1, 1, 1,
     1,  9, 1, 3, 1, 5, 1, 3, 1, 1,
     1,  5, 1, 5, 1, 3, 1, 3, 1, 1, 1,
     1, 11, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1,
     1,  6, 1, 1, 1, 5, 1, 3, 1, 3, 1, 1, 1,
     1, 13, 1, 3, 1, 3, 1, 7, 1, 5, 1, 3, 1, 1,
...
		

Crossrefs

Programs

  • Magma
    /* As triangle */ [[#[m: m in [0..n-k-1] | m^k mod (n-k) eq m]/
    #[m: m in [0..n-k-1] | -m^k mod (n-k) eq m]: k in [0..n-1]]: n in [1..13]];

Formula

T(n, 2*k) = 1; 1 <= T(n, 2*k+1) <= n.

A346669 Numbers r such that the number of nonnegative m < r such that m^k == m (mod r) is equal to k*(the number of nonnegative m < r such that -m^k == m (mod r)), where k = 2^A007814(r-1) + 1.

Original entry on oeis.org

3, 5, 7, 11, 13, 15, 17, 19, 23, 27, 29, 31, 35, 37, 39, 41, 43, 47, 51, 53, 55, 57, 59, 61, 67, 71, 73, 75, 79, 83, 85, 87, 89, 91, 95, 97, 101, 103, 107, 109, 111, 113, 115, 119, 123, 125, 127, 131, 135, 137, 139, 143, 149, 151, 155, 157, 159, 163, 167, 173, 175, 179, 181, 183, 187
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 28 2021

Keywords

Comments

Conjecture: this sequence contains odd prime numbers A065091, but does not contain Carmichael numbers A002997.
Proof from Jianing Song, Jun 14 2021: (Start)
Conjecture: Let v(n) = A007814(n) be the 2-adic valuation of n. Define
A(n) = A182816(n) as the number of nonnegative m < n such that m^n == m (mod n),
B(n) = A333570(n) as the number of nonnegative m < n such that m^n == -m (mod n),
C(n) as the number of nonnegative m < n such that m^(2^v(n-1)+1) == m (mod n), and
D(n) as the number of nonnegative m < n such that m^(2^v(n-1)+1) == -m (mod n).
Then A(n)/B(n) = n and C(n)/D(n) = 2^v(n-1) + 1 if and only if n is an odd prime.
The conjecture is correct.
"<=": If n is an odd prime, then A(n) = n, B(n) = 1, C(n) = 2^v(n) + 1, D(n) = 1.
"=>": If A(n)/B(n) = n, since A(n) <= n, we must have A(n) = n, so n is either prime or a Carmichael number.
Let n = (p_1)*(p_2)*...*(p_k) be a Carmichael number. Write d = v(n-1), s = (n-1)/2^d be odd.
If m^(2^d+1) == -m (mod n), then m^(2^d) == -1 (mod n/gcd(m,n)). Since m^(s+1) == 1 (mod n), we have (-1)^s == 1 (mod n/gcd(m,n)), so n/gcd(m,n) = 1, m = 0. This shows that D(n) = 1.
For gcd(m,n) = Product_{i in S} p_i, m^(2^v(n-1)+1) == m (mod n) is equivalent to m == 0 (mod Product_{i in S} p_i), m^(2^d) == 1 (mod Product_{i not in S} p_i). The number of solutions modulo n is Product_{i not in S} gcd(2^d, p_i-1). Hence we have C(n) = Sum_{S subset of {1,2,...,k}} Product_{i not in S} gcd(2^d, p_i - 1) = Product_{i=1..k} (1 + gcd(2^d, p_i-1)).
If n is a Carmichael number such that C(n)/D(n) = 2^d + 1, then Product_{i=1..k} (1 + gcd(2^d, p_i-1)) = 2^d + 1. Hence gcd(2^d, p_i-1) < 2^d for 1 <= i <= k. By Zsigmondy's Theorem, unless d = 1 or 3, 2^d + 1 has a primitive prime factor p such that p does not divide 2^e + 1 for all e < d. So we must have d = 1 or 3 (otherwise p does not divide Product_{i=1..k} (1 + gcd(2^d, p_i-1))), then k = 1 or 2. But a Carmichael number must have at least 3 prime factors, a contradiction! (End)
In the case k = r, this sequence contains odd prime and Carmichael numbers, but does not contain any other numbers.

Crossrefs

Programs

  • Magma
    [r: r in [2..190] | #[m: m in [0..r-1] | m^k mod r eq m] eq #[m: m in [0..r-1] | -m^k mod r eq m]*k where k is 2^Valuation(r-1, 2) + 1];
Showing 1-10 of 10 results.