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.

User: Labos Elemer

Labos Elemer's wiki page.

Labos Elemer has authored 3090 sequences. Here are the ten most recent ones:

A318883 Number of transient terms if unitary-proper-divisor-sum-function f(x) = A063919(x) is iterated and the initial value is n.

Original entry on oeis.org

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

Author

Antti Karttunen, Sep 22 2018, after Labos Elemer's A097033

Keywords

Comments

This sequence implements the original definition given for A097033.

Examples

			For n = 1, A063919(1) = 1, that is, we immediately end with a terminal cycle (of length 1 in this case), thus there are no transient part, and a(1) = 0.
For n = 2, A063919(2) = 1, and A063919(1) = 1, so we end with a terminal cycle after a transient part of length 1, thus a(2) = 1.
For n = 30, A063919(30) = 42, A063919(42) = 54, A063919(54) = 30, thus a(30) = a(42) = a(54) = 0, as 30, 42 and 54 are all contained in their own terminal cycle, without a preceding transient part.
For n = 1506, the iteration-list is {1506, 1518, 1938, 2382, 2394, 2406, [2418, 2958, 3522, 3534, 4146, 4158, 3906, 3774, 4434, 4446, 3954, 3966, 3978, 3582, 2418, ..., ad infinitum]}. After a transient of length 6 the iteration ends in a cycle of length 14, thus a(1506) = 6.
If a(n) = 0, then n is a term in an attractor set like A002827, A063991, A097024, A097030.
		

Programs

  • Mathematica
    a063919[1] = 1; (* function a[] in A063919 by Jean-François Alcover *)
    a063919[n_] := Total[Select[Divisors[n], GCD[#, n/#]==1&]]-n/;n>1
    transient[k_] := Module[{iter=NestWhileList[a063919, k, UnsameQ, All]}, Position[iter, Last[iter]][[1, 1]]]-1
    a318883[n_] := Map[transient, Range[n]]
    a318883[105] (* Hartmut F. W. Hoft, Jan 25 2024 *)
  • PARI
    A034460(n) = (sumdivmult(n, d, if(gcd(d, n/d)==1, d))-n); \\ From A034460
    A063919(n) = if(1==n,n,A034460(n));
    A318883(n) = { my(visited = Map()); for(j=1, oo, if(mapisdefined(visited, n), return(mapget(visited, n)-1), mapput(visited, n, j)); n = A063919(n)); };
    \\ Or by using lists:
    pil(item,lista) = { for(i=1,#lista,if(lista[i]==item,return(i))); (0); };
    A318883(n) = { my(visited = List([]), k); for(j=1, oo, if((k = pil(n,visited)) > 0, return(k-1)); listput(visited, n); n = A063919(n)); };

Formula

a(n) = A318882(n) - A097031(n).
a(n) = A097033(n) + A318880(n) - 1.

A318882 Total length of transient and terminal cycle if unitary-proper-divisor-sum function f(x) = A063919(x) is iterated and the initial value is n. Number of distinct terms in iteration list.

Original entry on oeis.org

1, 2, 2, 2, 2, 1, 2, 2, 2, 3, 2, 3, 2, 4, 3, 2, 2, 4, 2, 4, 3, 5, 2, 4, 2, 3, 2, 4, 2, 3, 2, 2, 4, 5, 3, 5, 2, 6, 3, 5, 2, 3, 2, 3, 4, 4, 2, 5, 2, 5, 4, 5, 2, 3, 3, 3, 3, 3, 2, 1, 2, 6, 3, 2, 3, 3, 2, 6, 3, 7, 2, 5, 2, 6, 3, 5, 3, 2, 2, 6, 2, 4, 2, 6, 3, 5, 5, 5, 2, 1, 4, 5, 4, 6, 3, 6, 2, 6, 4, 4, 2, 3, 2, 6, 6
Offset: 1

Author

Antti Karttunen, Sep 22 2018, after Labos Elemer's A097032

Keywords

Comments

This sequence implements the original definition given for A097032.

Examples

			For n = 1, A063919(1) = 1, that is, we immediately end with a terminal cycle of length 1 without a preceding transient part, thus a(1) = 0+1 = 1.
For n = 2, A063919(2) = 1, and A063919(1) = 1, so we end with a terminal cycle of length 1, after a transient part of length 1, thus a(2) = 1+1 = 2.
For n = 30, A063919(30) = 42, A063919(42) = 54, A063919(54) = 30, thus a(30) = a(42) = a(54) = 0+3 = 3, as 30, 42 and 54 are all contained in their own terminal cycle of length 3, without a preceding transient part.
For n = 1506, the iteration-list is {1506, 1518, 1938, 2382, 2394, 2406, [2418, 2958, 3522, 3534, 4146, 4158, 3906, 3774, 4434, 4446, 3954, 3966, 3978, 3582, 2418, ..., ad infinitum]}. After a transient of length 6 the iteration ends in a cycle of length 14, thus a(1506) = 6+14 = 20.
		

Crossrefs

Cf. A002827 (the positions of ones after the initial 1).

Programs

  • Mathematica
    a063919[1] = 1; (* function a[] in A063919 by Jean-François Alcover *)
    a063919[n_] := Total[Select[Divisors[n], GCD[#, n/#]==1&]]-n/;n>1
    a318882[n_] := Map[Length[NestWhileList[a063919, #, UnsameQ, All]]-1&, Range[n]]
    a318882[105] (* Hartmut F. W. Hoft, Jan 25 2024 *)
  • PARI
    A034460(n) = (sumdivmult(n, d, if(gcd(d, n/d)==1, d))-n); \\ From A034460
    A063919(n) = if(1==n,n,A034460(n));
    A318882(n) = { my(visited = Map()); for(j=1, oo, if(mapisdefined(visited, n), return(j-1), mapput(visited, n, j)); n = A063919(n)); };
    \\ Or by using lists:
    pil(item,lista) = { for(i=1,#lista,if(lista[i]==item,return(i))); (0); };
    A318882(n) = { my(visited = List([]), k); for(j=1, oo, if((k = pil(n,visited)) > 0, return(j-1)); listput(visited, n); n = A063919(n)); };

Formula

a(n) = A097031(n) + A318883(n).
a(n) = A097032(n) + A318880(n) - 1.

A318459 a(n) = gcd(n, tau(n), phi(n)), where tau = A000005 and phi = A000010.

Original entry on oeis.org

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

Author

Antti Karttunen, Sep 07 2018, after Labos Elemer's A074389

Keywords

Crossrefs

Programs

  • Mathematica
    Table[GCD[n,DivisorSigma[0,n],EulerPhi[n]],{n,110}] (* Harvey P. Dale, Jul 30 2019 *)
  • PARI
    A318459(n) = gcd([n, numdiv(n), eulerphi(n)]);

Formula

a(n) = gcd(n, A000005(n), A000010(n)).
a(n) = gcd(n,A009213(n)) = gcd(A000005(n),A009195(n)) = gcd(A000010(n),A009191(n)).

A118860 Numbers k such that k-1, k+1, 2k-1, 2k+1, 3k-1, 3k+1, 4k-1 and 4k+1 are all primes.

Original entry on oeis.org

21968100, 37674210, 81875220, 356467230, 416172330, 750662640, 1007393730, 1150070040, 1586271960, 1963954650, 3127171320, 3669568560, 4377895410, 4383541050, 5575083360, 5686935870, 5708418870, 7365234450, 7478474430, 7681046100, 8453862690, 8898688680
Offset: 1

Author

Labos Elemer, May 03 2006

Keywords

Comments

All terms are multiples of 210, hence simpler code is possible.

Examples

			21968100 is a term because 21968099, 21968101, 43936199, 43936201, 65904299, 65904301, 87872399, 87872401 are all prime.
		

Crossrefs

Subsequence of A014574, A066388 and A118859.
Subsequence: A349321.

Programs

  • Mathematica
    tb={};Do[If[(PrimeQ[n-1]&&PrimeQ[n+1])&& (PrimeQ[2*n-1]&&PrimeQ[2*n+1])&& (PrimeQ[3*n-1]&&PrimeQ[3*n+1])&& (PrimeQ[4*n-1]&&PrimeQ[4*n+1]), Print[n];AppendTo[tb,n]], {n,21968100,10^8,210}];tb
    Select[210*Range[424*10^5],AllTrue[{#-1,#+1,2#-1,2#+1,3#-1,3#+1,4#-1,4#+1},PrimeQ]&] (* Harvey P. Dale, Jul 23 2024 *)
  • PARI
    isok(k) = if(k % 210, 0, for(i = 1, 4, forstep(j = -1, 1, 2, if(!isprime(i*k-j), return(0)))); 1); \\ Amiram Eldar, Mar 13 2025

Formula

a(n) = 210*A174293(n).

Extensions

Edited by Don Reble, May 16 2006
a(20)-a(22) from Pontus von Brömssen, Oct 14 2021

A118859 Numbers k such that k-1, k+1, 2*k-1, 2*k+1, 3*k-1 and 3*k+1 are primes.

Original entry on oeis.org

6, 53550, 420420, 422310, 1624350, 2130240, 3399900, 5199810, 5246010, 6549270, 7384440, 7775880, 9516570, 9565710, 10430280, 11845260, 13207950, 14562870, 14619990, 18747960, 20099940, 21596820, 21968100, 24358950, 24610740, 26916120, 28359240, 30838080
Offset: 1

Author

Labos Elemer, May 03 2006

Keywords

Examples

			6 is a term because 5, 7, 11, 13, 17, 19 are all prime.
		

Crossrefs

Subsequence of A014574 and A066388.
Subsequences: A118860, A349321.

Programs

  • Mathematica
    Select[Range[25*10^6],AllTrue[Flatten[{#+{1,-1},2#+{1,-1},3#+{1,-1}}], PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 13 2016 *)
  • PARI
    isok(k) = isprime(k-1) && isprime(k+1) && isprime(2*k-1) && isprime(2*k+1) && isprime(3*k-1) && isprime(3*k+1); \\ Amiram Eldar, Mar 13 2025

Formula

a(n) = 6*A290811(n).

Extensions

Edited by Don Reble, May 16 2006
a(26)-a(28) from Jon E. Schoenfield, Dec 07 2021

A118114 a(n) = binomial(3n,n) mod((n+1)(n+2)).

Original entry on oeis.org

3, 3, 4, 15, 21, 28, 0, 81, 55, 99, 0, 0, 84, 120, 0, 153, 171, 285, 0, 231, 253, 0, 360, 0, 0, 0, 0, 522, 0, 496, 0, 561, 833, 945, 0, 703, 741, 156, 0, 861, 903, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2016, 1664, 2145, 2211, 3417, 0, 2415, 2485, 2556, 0
Offset: 1

Author

Labos Elemer, Apr 13 2006

Keywords

Comments

Compared with A118112: larger nonzero value more often and in non-monotonic order.

Examples

			For n=5, binomial(15,5) = 3003 = (5+1)*(5+2)*71 + 21, a(5) = 21, the residue.
Interestingly, a very large zone of zeros occurs between about n=5460 and n=7800, uninterrupted by nonzero residues.
		

Crossrefs

Programs

  • Maple
    seq(binomial(3*n,n) mod((n+1)*(n+2)),n=1..71); # Emeric Deutsch, Apr 15 2006
  • Mathematica
    Table[Mod[Binomial[3*k, k], (k + 1)*(k + 2)], {k, 1, 1000}]
  • PARI
    a(n) = binomial(3*n,n) % ((n+1)*(n+2)); \\ Michel Marcus, Jan 05 2017

A118112 a(n) = binomial(3n,n) mod (n+1).

Original entry on oeis.org

1, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 19, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 35, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Author

Labos Elemer, Apr 13 2006

Keywords

Comments

These divisibilities are analogous to those of Catalan numbers. For rather long sequences of consecutive integers, a(n)=0. For the first 10000 integers 9678 residues equals zero. See A118113.
If n+1 is in A061345, a(n)=0. This follows from Kummer's theorem. - Robert Israel, May 09 2018

Examples

			For n=9, binomial(27,7) = 4686825; 4686825 mod 10 = 5.
		

Crossrefs

Programs

  • Maple
    seq(binomial(3*n,n) mod (n+1), n=1..200); # Robert Israel, May 09 2018
  • Mathematica
    Table[Mod[Binomial[3*k,k],k+1],{k,500}]
  • PARI
    a(n) = binomial(3*n, n) % (n+1); \\ Michel Marcus, May 10 2018

Formula

a(n) = binomial(3n,n) mod (n+1).

Extensions

Mathematica program corrected by Harvey P. Dale, Dec 28 2012

A115560 Twin prime pairs k-1 and k+1 such that the squares of both are present in A115557.

Original entry on oeis.org

11, 13, 29, 31, 197, 199, 239, 241, 419, 421, 659, 661, 881, 883, 1019, 1021, 1061, 1063, 1481, 1483, 1877, 1879, 3167, 3169, 3821, 3823, 4019, 4021, 4049, 4051, 4787, 4789, 6359, 6361, 7589, 7591, 9437, 9439, 13691, 13693, 14447, 14449, 14627, 14629, 16451, 16453
Offset: 1

Author

Labos Elemer, Jan 25 2006

Keywords

Programs

  • Mathematica
    ta={{0}};tb={{0}}; Do[s=DivisorSigma[1,DivisorSigma[0,n]]; s1=DivisorSigma[0,DivisorSigma[1,n]]; If[Equal[s-s1,0]&&IntegerQ[Sqrt[n]&&PrimeQ[Sqrt[n]]],Print[n]; ta=Append[ta,n];tb=Append[tb,Sqrt[n]]],{n,1,100000000}] ta=Delete[ta,1];tb=Delete[tb,1];ni=Intersection[tb,2+tb]; Union[ni,ni-2]
  • PARI
    isok(n) = issquare(n) && (sigma(numdiv(n)) == numdiv(sigma(n))); \\ A115557
    lista(nn) = {forprime(p=2, nn, if (isprime(p+2) && isok(p^2) && isok((p+2)^2), print1(p, ", ", p+2, ", ")););} \\ Michel Marcus, Jul 17 2019

Formula

The commutator [sigma, tau] is zero and a(n) is the square root of special prime solutions. These solutions are twin primes. Both twins are displayed.

Extensions

More terms from Amiram Eldar, Jul 17 2019

A115558 a(n) is the square root of A115557(n).

Original entry on oeis.org

1, 7, 11, 13, 19, 23, 29, 31, 43, 47, 53, 73, 83, 97, 103, 113, 127, 157, 179, 197, 199, 223, 227, 233, 239, 241, 251, 257, 271, 281, 311, 316, 317, 333, 353, 389, 401, 409, 419, 421, 443, 449, 461, 467, 479, 491, 503, 509, 549, 563, 587, 593, 599, 617, 641
Offset: 1

Author

Labos Elemer, Jan 25 2006

Keywords

Programs

  • Mathematica
    Select[Range[1000], DivisorSigma[0, DivisorSigma[1, #^2]] == DivisorSigma[1, DivisorSigma[0, #^2]] &] (* Amiram Eldar, Jan 28 2025 *)
  • PARI
    isok(k) = numdiv(sigma(k^2)) == sigma(numdiv(k^2)); \\ Amiram Eldar, Jan 28 2025

Formula

The commutator [sigma, tau] is zero and a(n) is the square root of solutions. Both prime and composite numbers.

A115559 Nonprime terms of A115558.

Original entry on oeis.org

1, 316, 333, 549, 844, 963, 981, 1052, 1233, 1251, 1304, 1341, 1359, 1474, 1629, 1688, 1737, 1738, 1996, 2061, 2144, 2216, 2421, 2528, 2547, 2763, 2979, 3033, 3082, 3123, 3141, 3148, 3231, 3244, 3283, 3303, 3411, 3573, 3634, 3871, 3879, 3897, 3988, 4113
Offset: 1

Author

Labos Elemer, Jan 25 2006

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[5000], !PrimeQ[#] && DivisorSigma[0, DivisorSigma[1, #^2]] == DivisorSigma[1, DivisorSigma[0, #^2]] &] (* Amiram Eldar, Jan 28 2025 *)
  • PARI
    isok(n)= !isprime(n) && (sigma(numdiv(n^2)) == numdiv(sigma(n^2))); \\ Michel Marcus, Dec 20 2013

Formula

The commutator [sigma, tau] is zero and a(n) is the square root of solutions. Moreover this square root is a nonprime number.