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

A124240 Numbers n such that lambda(n) divides n, where lambda is Carmichael's function (A002322).

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, 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, 420, 432, 440, 468, 480
Offset: 1

Views

Author

Alexander Adamchuk, Oct 22 2006

Keywords

Comments

Numbers n such that A124239(n) is divisible by n.
If k is in the sequence then 2k is also in the sequence, but if 2m is in the sequence m is not necessarily a term of the sequence.
This sequence is a subsequence of A068563. The first term that is different is A068563(27) = 136. The terms of A068563 that are not the terms of a(n) are listed in A124241.
Also, the sequence of numbers n such that p-1 divides n for all primes p that divide n. - Leroy Quet, Jun 27 2008
Numbers n such that b^n == 1 (mod n) for every b coprime to n. - Thomas Ordowski, Jun 23 2017
Numbers m such that every divisor < m is the difference between two divisors of m. - Michel Lagneau, Aug 11 2017
All terms > 1 in this sequence are even. Furthermore, either 4 or 6 divides a(n) for n > 3. 1806 is the largest squarefree term. - Paul Vanderveen, Apr 24 2022

Examples

			a(1) = 1 because 1 divides A124239(1) = 1.
a(2) = 2 because 2 divides A124239(2) = 14.
a(3) = 4 because 4 divides A124239(4) = 3704, but 3 does not divide A124239(3) = 197.
		

Crossrefs

Programs

  • Haskell
    a124240 n = a124240_list !! (n-1)
    a124240_list = filter
       (\x -> all (== 0) $ map ((mod x) . pred) $ a027748_row x) [1..]
    -- Reinhard Zumkeller, Aug 27 2013
    
  • Maple
    a:= proc(n) option remember; local k;
           for k from `if`(n=1, 0, a(n-1))+1 while
           irem(k, numtheory[lambda](k))>0 do od: k
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jul 04 2021
    # Using function 'Clausen' from A160014:
    aList := m -> select(k -> irem(Clausen(k, 1), Clausen(k, 0)) = 0, [seq(1..m)]):
    aList(480); # Peter Luschny, Jun 08 2023
  • Mathematica
    Do[f=n + Sum[ (2k-1)((2k-1)^n-1) / (2(k-1)), {k,2,n} ]; If[IntegerQ[f/n],Print[n]],{n,1,900}]
    Flatten[Position[Table[n/CarmichaelLambda[n], {n, 440}], Integer]] (* _T. D. Noe, Sep 11 2008 *)
  • PARI
    is(n)=n%lcm(znstar(n)[2])==0 \\ Charles R Greathouse IV, Feb 11 2015
    
  • Python
    from itertools import islice, count
    from sympy.ntheory.factor_ import reduced_totient
    def A124240gen(): return filter(lambda n:n % reduced_totient(n) == 0,count(1))
    A124240_list = list(islice(A124240gen(),20)) # Chai Wah Wu, Dec 11 2021

Formula

k is in a <=> Clausen(k, 0) divides Clausen(k, 1), (Clausen = A160014). - Peter Luschny, Jun 08 2023

Extensions

New definition from T. D. Noe, Aug 31 2008
Edited by Max Alekseyev, Aug 25 2013

A034380 Ratio of totient to Carmichael's lambda function: a(n) = A000010(n) / A002322(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 4, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 4, 1, 2, 1, 2, 2, 1, 1, 4, 1, 1, 2, 2, 1, 1, 2, 4, 2, 1, 1, 4, 1, 1, 6, 2, 4, 2, 1, 2, 2, 2, 1, 4, 1, 1, 2, 2, 2, 2, 1, 8, 1, 1, 1, 4, 4, 1, 2, 4, 1, 2, 6, 2, 2, 1, 2, 4, 1, 1, 2, 2, 1, 2, 1, 4, 4
Offset: 1

Views

Author

Keywords

Comments

a(n)=1 if and only if the multiplicative group modulo n is cyclic (that is, if n is either 1, 2, 4, or of the form p^k or 2*p^k where p is an odd prime). In other words: a(n)=1 if n is a term of A033948, otherwise a(n) > 1 (and n is a term of A033949). - Joerg Arndt, Jul 14 2012

Crossrefs

Programs

Formula

a(n) = A000010(n) / A002322(n).
a(A033948(n)) = 1 [Banks & Luca]. - R. J. Mathar, Jul 29 2007
A002322(n)/A007947(a(n)) = A289624(n). - Antti Karttunen, Jul 17 2017

A061257 Euler transform of reduced totient function psi(n), cf. A002322.

Original entry on oeis.org

1, 1, 2, 4, 7, 13, 21, 37, 58, 96, 153, 243, 376, 584, 897, 1353, 2046, 3060, 4552, 6714, 9862, 14386, 20898, 30198, 43427, 62159, 88600, 125804, 177881, 250615, 351819, 492203, 686294, 953954, 1321902, 1826394, 2516364, 3457332, 4737576, 6475332
Offset: 0

Views

Author

Vladeta Jovovic, Apr 21 2001

Keywords

Crossrefs

Programs

  • Mathematica
    nn = 20; b = Table[CarmichaelLambda[n], {n, nn}]; CoefficientList[Series[Product[1/(1 - x^m)^b[[m]], {m, nn}], {x, 0, nn}], x] (* T. D. Noe, Jun 19 2012 *)

Formula

G.f.: Product_{k=1..infinity} (1 - x^k)^(-psi(k)). a(n)=1/n*Sum_{k=1..n} a(n-k)*b(k), n>1, a(0)=1, b(k)=Sum_{d|k} d*psi(d), cf. A061258.

A303756 Number of values of k, 1 <= k <= n, with A002322(k) = A002322(n), where A002322 is Carmichael lambda.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 30 2018

Keywords

Comments

Ordinal transform of A002322.

Crossrefs

Cf. A002322.
Cf. also A081373, A303755, A303758.

Programs

  • Mathematica
    a[n_] := With[{c = CarmichaelLambda[n]}, Select[Range[n], c == CarmichaelLambda[#]&] // Length];
    Array[a, 1000] (* Jean-François Alcover, Sep 19 2020 *)
  • PARI
    up_to = 65537;
    ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
    A002322(n) = lcm(znstar(n)[2]); \\ From A002322
    v303756 = ordinal_transform(vector(up_to,n,A002322(n)));
    A303756(n) = v303756[n];

Formula

Except for a(2) = 2, a(n) = A303758(n).

A264012 Composite numbers n such that gcd(phi(n), n-1) = lambda(n), where lambda(n) = A002322(n).

Original entry on oeis.org

561, 1105, 2821, 6601, 10585, 29341, 52633, 62745, 63973, 101101, 115921, 126217, 188461, 252601, 278545, 294409, 410041, 512461, 552721, 748657, 825265, 1152271, 1193221, 2100901, 2508013, 2531845, 3146221, 4335241, 4767841, 4909177, 5444489, 5481451, 6049681
Offset: 1

Views

Author

Thomas Ordowski, Nov 01 2015

Keywords

Comments

Carmichael numbers n such that A049559(n) = A002322(n).
If n is a Carmichael number with n-1 squarefree, then n is in the sequence. The smallest such n = 139952671.
If (n-1)/lambda(n) is a prime (see A174590), then n is in the sequence. - Thomas Ordowski, Oct 17 2016
Numbers n such that gcd(phi(n),n-1) = lambda(n)^2 are 1, 2, 2320690177, ? - Thomas Ordowski and Michel Marcus, Oct 20 2016

Crossrefs

Programs

  • Mathematica
    Select[ Range@ 6100000, CompositeQ@# && GCD[ EulerPhi@#, # - 1] == CarmichaelLambda@# &] (* Michael De Vlieger, Nov 01 2015 *)
  • PARI
    forcomposite(n=1, 1e7, if(gcd(eulerphi(n),n-1)==lcm(znstar(n)[2]), print1(n ", "))) \\ Altug Alkan, Nov 01 2015
    
  • PARI
    t(n)=my(f=factor(n)); for(i=1, #f[, 1], if(f[i, 2]>1||(n-1)%(f[i, 1]-1), return(0))); 1;
    is(n)=n%2 && !isprime(n) && t(n) && n>1;
    c(n)=gcd(eulerphi(n),n-1)/lcm(znstar(n)[2]);
    for(n=1, 1e7, if(is(n) && c(n)==1 , print1(n", "))) \\ Altug Alkan, Nov 01 2015

Extensions

More terms from Altug Alkan, Nov 01 2015

A307437 a(n) is the smallest k such that 2n divides psi(k), psi = A002322.

Original entry on oeis.org

3, 5, 7, 17, 11, 13, 29, 17, 19, 25, 23, 73, 53, 29, 31, 97, 103, 37, 191, 41, 43, 89, 47, 97, 101, 53, 81, 113, 59, 61, 311, 193, 67, 137, 71, 73, 149, 229, 79, 187, 83, 203, 173, 89, 181, 235, 283, 97, 197, 101, 103, 313, 107, 109, 121, 113, 229, 233, 709, 241
Offset: 1

Views

Author

Jianing Song, Apr 08 2019

Keywords

Comments

a(n) exists for all n: by Dirichlet's theorem on arithmetic progressions, there exists a prime p congruent to 1 modulo 2n, so 2n divides psi(p) = p - 1.
a(n) is the smallest k such that (Z/kZ)* contains C_(2n) as a subgroup, where (Z/kZ)* is the multiplicative group of integers modulo n.
a(n) is the smallest k such that there exists some x such that ord(x,k) = 2n, where ord(x,k) is the multiplicative order of x modulo k.
Record values of a(n)/n occur at n = 1, 4, 12, 19, 59, 167, 196, 197, 227, 317, 457, 521, 706, ... (A341888).
From Jianing Song, Feb 21 2021: (Start)
a(n) is bounded above by (2n)^2 since n divides psi(n^2).
a(n) is usually odd. There are only 7 values <= 10^4 for n such that a(n) is even, namely n = 256, 512, 1024, 2816, 4096, 5632 and 8192 (A341887). (End)
a(n) is odd or divisible by 16, since psi(k) = psi(2k) = psi(4k) = psi(8k) for odd k > 1. - Jianing Song, Feb 22 2021

Examples

			For n = 7, psi(29) = 28 and 29 is the smallest k such that 14 divides psi(k), so a(7) = 29.
For n = 27, psi(81) = 54 and 81 is the smallest k such that 54 divides psi(k), so a(27) = 81.
For n = 40, psi(187) = 80 and 187 is the smallest k such that 80 divides psi(k), so a(40) = 187.
For n = 42, psi(203) = 84 and 203 is the smallest k such that 84 divides psi(k), so a(42) = 203.
		

Crossrefs

Programs

  • Maple
    N:= 100: # for a(1)..a(N)
    V:= Vector(N): count:= 0:
    for k from 3 while count < N do
      S:= select(t -> t <= N and V[t]=0, numtheory:-divisors(numtheory:-lambda(k)/2));
      if nops(S) > 0 then count:= count + nops(S); V[convert(S,list)]:= k fi
    od:
    convert(V,list); # Robert Israel, Jul 10 2019
  • PARI
    a(n) = my(i=1); while(A002322(i)%(2*n), i++); i \\ See A002322 for its program
    
  • Python
    from sympy import reduced_totient
    def A307437(n):
        k = 1
        while reduced_totient(k) % (2*n):
            k += 1
        return k # Chai Wah Wu, Feb 24 2021

Formula

From Jianing Song, Feb 26 2021: (Start)
For odd prime p, a((p-1)/2*p^e) = p^(e+1) if (p-1)*p^e+1 is composite, (p-1)*p^e+1 otherwise. Proof: suppose a((p-1)/2*p^e) = p^a*r < p^(e+1), p does not divide r, then (p-1)*p^e | lcm((p-1)*p^(a-1), psi(r)) => p^e | lcm(p^(a-1), psi(r)).
If p^e | p^(a-1), then a((p-1)/2*p^e) >= p^a >= p^(e+1).
If p^e does not divide p^(a-1), then p^e | psi(r). r must have a prime factor of the form q = 2*t*p^e+1. If a >= 1, then a((p-1)/2*p^e) >= p*(2*p^e+1) > p^(e+1). So we must have a = 0. Write r = r'*q^b, then p-1 | lcm(psi(r'), 2*t*p^e*q^(b-1)) => p-1 | lcm(psi(r'), 2*t), hence 2*t*r' >= 2*t*psi(r') >= lcm(psi(r'), 2*t) => p-1. If 2*t*r' > p-1, then a((p-1)/2*p^e) >= r'*q = r'*(2*t*p^e+1) > p^(e+1). If 2*t*r' = p-1, then r' = psi(r') => r' = 1, 2*t = p-1, hence (p-1)*p^e+1 is prime. (End)

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

A277127 a(n) = n - lambda(n), where lambda(n) = A002322(n).

Original entry on oeis.org

0, 1, 1, 2, 1, 4, 1, 6, 3, 6, 1, 10, 1, 8, 11, 12, 1, 12, 1, 16, 15, 12, 1, 22, 5, 14, 9, 22, 1, 26, 1, 24, 23, 18, 23, 30, 1, 20, 27, 36, 1, 36, 1, 34, 33, 24, 1, 44, 7, 30, 35, 40, 1, 36, 35, 50, 39, 30, 1, 56, 1, 32, 57, 48, 53, 56, 1, 52, 47, 58, 1, 66, 1, 38, 55, 58, 47, 66, 1, 76, 27, 42, 1
Offset: 1

Views

Author

Thomas Ordowski, Oct 01 2016

Keywords

Comments

Largest m < n such that b^m == b^n (mod n) for every integer b.

Crossrefs

Programs

  • Mathematica
    Table[n - CarmichaelLambda@ n, {n, 83}] (* Michael De Vlieger, Oct 01 2016 *)
  • PARI
    a(n) = n - lcm(znstar(n)[2]); \\ Altug Alkan, Oct 01 2016

Formula

a(p) = 1 for prime p.
a(p^2) = p prime.
a(n) = A051953(n) for n in A033948.

Extensions

More terms from Altug Alkan, Oct 01 2016

A296077 a(n) = 1 if 1 + A002322(n) is prime, 0 otherwise, where A002322 is Carmichael lambda.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1
Offset: 1

Views

Author

Antti Karttunen, Dec 05 2017

Keywords

Comments

Out of the first 65537 values, 39743 are 1's (indicating primes), and 25794 are 0's, indicating nonprimes.

Crossrefs

Characteristic function for A263028.
Cf. A002322, A010051, A263027, A263029 (positions of zeros), A296076, A296079.

Programs

  • Mathematica
    Table[If[PrimeQ[CarmichaelLambda[n]+1],1,0],{n,120}] (* Harvey P. Dale, Sep 23 2020 *)
  • PARI
    A296077(n) = isprime(1+lcm(znstar(n)[2]));

Formula

a(n) = A010051(A263027(n)) = A010051(1+A002322(n)).

A376849 Numbers k such that psi(k + psi(k)) = psi(k) + psi(psi(k)), where psi = A002322.

Original entry on oeis.org

2, 5, 10, 34, 80, 111, 196, 204, 222, 328, 351, 646, 654, 704, 837, 876, 935, 943, 969, 1053, 1100, 1140, 1220, 1224, 1372, 1408, 1526, 1824, 1864, 2368, 2496, 2511, 2715, 2816, 2842, 3159, 3294, 3528, 3648, 3672, 4332, 4473, 4600, 4736, 4992, 5500, 5632, 6325, 6528, 7296, 7412, 7512, 7533, 7832, 7959
Offset: 1

Views

Author

Robert Israel, Oct 06 2024

Keywords

Examples

			a(3) = 10 is a term because psi(10) = 4, psi(4) = 2, and psi(10 + 4) = psi(14) = 6 = 4 + 2.
		

Crossrefs

Programs

  • Maple
    filter:= proc(k) uses numtheory; local s;
     s:= lambda(k);
     lambda(k+s) = s + lambda(s)
    end proc:
    select(filter, [$1..10000]);
  • Mathematica
    Select[Range[8000], CarmichaelLambda[ #+CarmichaelLambda[#]] == CarmichaelLambda[#]+CarmichaelLambda[CarmichaelLambda[#]] &] (* Stefano Spezia, Oct 07 2024 *)
Showing 1-10 of 308 results. Next