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

A064664 Regard A064413 as giving a permutation of the positive integers; sequence gives inverse permutation.

Original entry on oeis.org

1, 2, 5, 3, 10, 4, 14, 8, 6, 9, 20, 7, 28, 13, 11, 17, 33, 12, 37, 18, 15, 19, 43, 16, 24, 27, 22, 26, 57, 23, 61, 31, 21, 32, 25, 30, 67, 36, 29, 40, 74, 35, 81, 41, 39, 42, 89, 45, 50, 46, 34, 47, 100, 48, 53, 49, 38, 56, 107, 52, 115, 60, 51, 64, 54, 59, 128, 65, 44, 55
Offset: 1

Views

Author

N. J. A. Sloane, Oct 11 2001

Keywords

Comments

The Mathematica program computes the EKG sequence A064413 and then determines the inverse permutation. - T. D. Noe, Nov 13 2002

Examples

			Original permutation has cycles (1) (2) (3, 4, 6, 9, 10, 5) (..., 20, 18, 12, 7, 14, 13, 28, 26, ...) (8) ...
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a064664 = (+ 1) . fromJust . (`elemIndex` a064413_list)
    -- Reinhard Zumkeller, May 01 2014, Sep 17 2011
  • Mathematica
    maxN=200; lst={1, 2}; unused=Range[3, maxN]; found=True; While[found, found=False; i=0; While[ !found&&i1, found=True; AppendTo[lst, unused[[i]]]; unused=Delete[unused, i]]]]; Take[Ordering[lst], unused[[1]]-1]

A064955 Position of n-th prime in A064413.

Original entry on oeis.org

2, 5, 10, 14, 20, 28, 33, 37, 43, 57, 61, 67, 74, 81, 89, 100, 107, 115, 128, 134, 138, 151, 160, 167, 182, 189, 197, 203, 207, 216, 236, 253, 259, 264, 279, 287, 297, 305, 314, 328, 336, 344, 363, 371, 377, 381, 401, 420, 430, 438, 444, 458, 462, 474, 487, 501, 510, 517, 530, 540, 549, 557, 581, 587, 599, 606, 629, 639, 655, 664, 670, 681, 699, 707, 724, 730, 736, 756, 766, 781, 798, 802, 814, 819, 833, 848, 857, 874, 882, 889, 898, 911, 927, 942, 953, 961, 971, 997, 1004, 1029, 1041, 1059, 1072, 1080, 1087, 1099, 1118, 1135, 1142, 1150, 1156, 1175, 1181, 1190, 1203, 1223, 1232, 1242, 1249, 1258, 1266, 1287, 1298, 1306, 1324, 1350, 1357, 1378, 1391, 1398, 1410, 1425, 1433, 1442, 1456, 1470, 1478, 1504, 1516, 1542, 1546, 1564, 1568, 1578, 1586, 1610, 1626, 1638, 1646, 1652, 1680, 1686, 1693, 1702, 1734, 1739, 1760
Offset: 1

Views

Author

N. J. A. Sloane, Oct 30 2001

Keywords

Comments

It can be shown that this sequence is monotonic.
A073734(a(n)) = A000040(n) for n > 1. - Reinhard Zumkeller, Sep 17 2001

Crossrefs

Setwise difference A383294 \ A383295.

Programs

Formula

a(n) = A064664(A000040(n)).

A152458 Numbers k that A064413(k) = k.

Original entry on oeis.org

1, 2, 8, 40, 64
Offset: 1

Views

Author

Artur Jasinski, Dec 05 2008

Keywords

Comments

Conjecture: This sequence is finite.
Contribution from Artur Jasinski, Dec 08 2008: (Start)
The EKG sequence A064413 has 3 critical lines.
Numbers which belong to the critical lines:
(1) A064413(k) = k see this sequence,
(3/2) 2*A064413(k) = 3*k see A152519,
(1/2) 2*A064413(k) = k has only 2 numbers {10, 14}.
Because points are concentrated on the plot of EKG sequence near these 3 critical lines, the number of points belonging to critical lines is surprisingly low.
Is this sequence complete? (End)
Also fixed points of A247379. - Reinhard Zumkeller, Sep 15 2014
a(6) > 10^5, if it exists. - Amiram Eldar, Oct 23 2024

Crossrefs

Programs

  • Haskell
    a152458 n = a152458_list !! (n-1)
    a152458_list = [x | x <- [1..], a064413 x == x]
    -- Reinhard Zumkeller, Sep 15 2014

A064421 Term at which n appears in A064413 (if it begins at 2).

Original entry on oeis.org

0, 1, 4, 2, 9, 3, 13, 7, 5, 8, 19, 6, 27, 12, 10, 16, 32, 11, 36, 17, 14, 18, 42, 15, 23, 26, 21, 25, 56, 22, 60, 30, 20, 31, 24, 29, 66, 35, 28, 39, 73, 34, 80, 40, 38, 41, 88, 44, 49, 45, 33, 46, 99, 47, 52, 48, 37, 55, 106, 51, 114, 59, 50, 63, 53, 58, 127, 64, 43, 54, 133
Offset: 1

Views

Author

Jonathan Ayres (Jonathan.ayres(AT)btinternet.com), Sep 30 2001

Keywords

Comments

Every nonnegative number appears here exactly once.

Crossrefs

Cf. A064413. Equals A064664 - 1.

Programs

  • Mathematica
    terms = 100;
    ekg[s_] := Block[{m = s[[-1]], k = 3}, While[MemberQ[s, k] || GCD[m, k] == 1, k++]; Append[s, k]];
    EKG = Nest[ekg, {2, 4}, 2 terms];
    a[1] = 0; a[n_] := FirstPosition[EKG, n] // First;
    Array[a, terms] (* Jean-François Alcover, Aug 30 2018, after Robert G. Wilson v *)

Extensions

More terms from Naohiro Nomoto, Sep 30 2001

A073734 GCD of consecutive members of the EKG sequence A064413.

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 4, 2, 5, 5, 3, 2, 7, 7, 3, 8, 4, 2, 11, 11, 3, 3, 5, 5, 7, 2, 13, 13, 3, 4, 2, 17, 17, 3, 2, 19, 19, 3, 5, 4, 2, 23, 23, 3, 2, 2, 2, 2, 7, 7, 3, 5, 5, 5, 2, 29, 29, 3, 2, 31, 31, 3, 8, 4, 2, 37, 37, 3, 3, 2, 4, 2, 41, 41, 3, 3, 7, 11, 2, 43, 43, 3, 5, 5, 5, 4, 2, 47, 47, 3, 2, 7
Offset: 2

Views

Author

David Wasserman, Aug 06 2002

Keywords

Comments

All terms shown are prime powers, but this does not hold for all n. For n > 2, a(n) is divisible by A064740(n).
The GCD of A064413(578)=620 and A064413(579)=610 is 10. This is the first time the GCD is not a prime-power. - N. J. A. Sloane, Mar 30 2015
a(A064955(n)) = A000040(n) for n > 1. [Reinhard Zumkeller, Sep 17 2001]
From Jianing Song, Sep 27 2023: (Start)
Based on the data of A064413, one finds that a(n) is not a prime power for 39 n's not exceeding 10000. Specifically, we have:
- a(n) = 6 for n = 968, 2236, 3330, 3496, 7773, 8957;
- a(n) = 10 for n = 579, 1221, 1428, 1604, 2092, 2872, 3048, 4434, 4697, 7355, 7448, 8923;
- a(n) = 14 for n = 9018, 2126, 8324;
- a(n) = 15 for n = 9369, 2406, 4085, 4194, 4887, 5846, 6484, 6846, 7939, 8746;
- a(n) = 20 for n = 2935, 5446, 5910, 9093;
- a(n) = 21 for n = 7468;
- a(n) = 26 for n = 1065, 5148;
- a(n) = 38 for n = 2117.
What is the first n such that a(n) = 12? And for a(n) = 18? (End)

Examples

			a(8) = 4 because gcd(A064413(7), A064413(8)) = gcd(12, 8) = 4.
From _Michael De Vlieger_, Sep 27 2023: (Start)
Let b(n) = A064413(n):
a(11068) = 12 since gcd(b(11067), b(11068)) = gcd(11484, 11472) = 12,
a(58836) = 18 since gcd(b(58835), b(58836)) = gcd(60786, 60678) = 18. (End)
		

Crossrefs

Programs

  • Haskell
    a073734 n = a073734_list !! (n-2)
    a073734_list = zipWith gcd a064413_list $ tail a064413_list
    -- Reinhard Zumkeller, Sep 17 2001
  • Mathematica
    t = {1, 2}; Join[{1}, Table[k = 3; While[MemberQ[t, k] || (y = GCD[Last[t], k]) == 1, k++];AppendTo[t, k]; y, {91}]] (* Jayanta Basu, Jul 09 2013 *)

Formula

a(n) = gcd(A064413(n-1), A064413(n)).

A265576 LCM-transform of EKG sequence A064413.

Original entry on oeis.org

1, 2, 2, 3, 1, 3, 1, 2, 5, 1, 1, 1, 7, 1, 1, 1, 2, 1, 11, 1, 1, 3, 1, 5, 1, 1, 13, 1, 1, 1, 2, 17, 1, 1, 1, 19, 1, 1, 1, 1, 1, 23, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 29, 1, 1, 1, 31, 1, 1, 1, 2, 1, 37, 1, 1, 1, 1, 1, 1, 41, 1, 1, 3, 1, 1, 1, 43, 1, 1, 1, 1, 1, 1, 1, 47, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 53
Offset: 1

Views

Author

N. J. A. Sloane, Jan 02 2016

Keywords

Comments

This is not equal to A383293(n) = A014963(A064413(n)) because the EKG-permutation doesn't satisfy the property that all prime powers should appear before any of their multiples, as, for example, A064413(4) = 6 comes before A064413(5) = 3. See comments in A368900. - Antti Karttunen, Jan 13 2024

Crossrefs

Cf. A064413, A383284 (rgs-transform), A383285 (positions of terms > 1), A383295.
Positions of records: {2} U A064423.
Other LCM-transforms are A014963, A061446, A265574, A265575, A368900 (see the last one for many other examples), A383258.
Cf. also A383293.

Programs

  • Maple
    LCMXfm:=proc(a) local L,i,n,g,b;
    L:=nops(a);
    g:=Array(1..L,0); b:=Array(1..L,0);
    b[1]:=a[1]; g[1]:=a[1];
    for n from 2 to L do g[n]:=ilcm(g[n-1],a[n]); b[n]:=g[n]/g[n-1]; od;
    lprint([seq(b[i],i=1..L)]);
    end;
    # let t1 contain the first 100 terms of A064413
    LCMXfm(t1);
  • Mathematica
    LCMXfm[a_List] := Module[{L = Length[a], b, g}, b[1] = g[1] = a[[1]]; b[] = 0; g[] = 0; Do[g[n] = LCM[g[n - 1], a[[n]]]; b[n] = g[n]/g[n - 1], {n, 2, L}]; Array[b, L]];
    ekg[1] = 1; ekg[2] = 2; ekg[n_] := ekg[n] = For[k = 1, True, k++, If[FreeQ[ Array[ekg, n - 1], k] && !CoprimeQ[k, ekg[n - 1]], Return[k]]];
    LCMXfm[Array[ekg, 100]] (* Jean-François Alcover, Dec 05 2017 *)
  • PARI
    LCMtransform(v) = { my(len = length(v), b = vector(len), g = vector(len)); b[1] = g[1] = 1; for(n=2, len, g[n] = lcm(g[n-1], v[n]); b[n] = g[n]/g[n-1]); (b); };
    up_to = 20000;
    v265576 = LCMtransform(vector(up_to, i, A064413(i))); \\ With precomputed A064413.
    A265576(n) = v265576[n]; \\ Antti Karttunen, Apr 21 2025

Formula

a(n) = lcm {1..A064413(n)} / lcm {1..A064413(n-1)}. - Antti Karttunen, Apr 21 2025

Extensions

More terms from Antti Karttunen, Apr 21 2025

A240024 Nonprime EKG sequence, cf. A064413: a(1) = 1, a(2) = 4 and for n > 2, a(n) = smallest composite number not already used which shares a factor with a(n-1).

Original entry on oeis.org

1, 4, 6, 8, 10, 12, 9, 15, 18, 14, 16, 20, 22, 24, 21, 27, 30, 25, 35, 28, 26, 32, 34, 36, 33, 39, 42, 38, 40, 44, 46, 48, 45, 50, 52, 54, 51, 57, 60, 55, 65, 70, 49, 56, 58, 62, 64, 66, 63, 69, 72, 68, 74, 76, 78, 75, 80, 82, 84, 77, 88, 86, 90, 81, 87, 93
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 30 2014

Keywords

Comments

A239965 gives the position of the n-th nonprime; a(A239965(n))=A018252(n).

Crossrefs

Cf. A064413, A064664 (EKG sequence).

Programs

  • Haskell
    import Data.List (delete, genericIndex)
    a240024 n = genericIndex a240024_list (n - 1)
    a240024_list = 1 : ekg 4 a002808_list where
       ekg x zs = f zs where
           f (y:ys) = if gcd x y > 1 then y : ekg y (delete y zs) else f ys
  • Mathematica
    a = {1, 4}; Do[k = 6; While[Or[PrimeQ@ k, MemberQ[a, k], CoprimeQ[a[[i - 1]], k]], k++]; AppendTo[a, k], {i, 3, 66}]; a (* Michael De Vlieger, Sep 01 2016 *)

A349614 Dirichlet convolution of A064664 (the inverse permutation of EKG-permutation, A064413) with the Dirichlet inverse of A064413.

Original entry on oeis.org

1, 0, 1, -3, 7, -7, 2, 6, -8, -10, 5, 9, 14, 2, -41, -1, 17, 27, 15, -6, -38, -18, 13, 10, -32, -29, 18, 33, 18, 62, 29, -13, -31, -53, -107, 25, 48, -51, -86, 13, 30, 116, 58, 23, 88, -34, 37, -47, -30, 56, -113, 3, 45, -39, -137, -154, -73, -67, 41, 160, 84, -91, 174, 56, -154, 152, 91, 6, -113, 246, 58, -185, 56
Offset: 1

Views

Author

Antti Karttunen, Nov 23 2021

Keywords

Comments

Obviously, convolving this with A064413 gives its inverse permutation A064664.

Crossrefs

Cf. A064413, A064664, A349400, A349613 (Dirichlet inverse), A349615 (sum with it), A349617.
Cf. also pairs A349376, A349377 and A349397, A349398 for similar constructions.

Programs

  • PARI
    up_to = 32768;
    v064413 = readvec("b064413_upto65539_terms_only.txt"); \\ Data prepared with Chai Wah Wu's Dec 08 2014 Python-program given in A064413.
    A064413(n) = v064413[n];
    \\ Then its inverse A064664 is prepared:
    m064664 = Map();
    for(n=1,65539,mapput(m064664,A064413(n),n));
    A064664(n) = mapget(m064664,n);
    memoA349400 = Map();
    A349400(n) = if(1==n,1,my(v); if(mapisdefined(memoA349400,n,&v), v, v = -sumdiv(n,d,if(dA064413(n/d)*A349400(d),0)); mapput(memoA349400,n,v); (v)));
    A349614(n) = sumdiv(n,d,A064664(d)*A349400(n/d));

Formula

a(n) = Sum_{d|n} A064664(d) * A349400(n/d).

A064423 Position of n-th prime in A064413 (if it begins at 2).

Original entry on oeis.org

1, 4, 9, 13, 19, 27, 32, 36, 42, 56, 60, 66, 73, 80, 88, 99, 106, 114, 127, 133, 137, 150, 159, 166, 181, 188, 196, 202, 206, 215, 235, 252, 258, 263, 278, 286, 296, 304, 313, 327, 335, 343, 362, 370, 376, 380, 400, 419, 429, 437, 443, 457, 461, 473, 486, 500, 509, 516, 529, 539, 548, 556, 580, 586, 598, 605, 628, 638, 654, 663, 669, 680, 698, 706, 723, 729, 735, 755, 765, 780, 797, 801, 813, 818, 832, 847, 856, 873, 881, 888, 897, 910, 926, 941, 952, 960, 970, 996, 1003, 1028, 1040, 1058, 1071, 1079, 1086, 1098, 1117, 1134, 1141, 1149, 1155, 1174, 1180, 1189, 1202, 1222, 1231, 1241, 1248, 1257, 1265, 1286, 1297, 1305, 1323, 1349, 1356, 1377, 1390, 1397, 1409, 1424, 1432, 1441, 1455, 1469, 1477, 1503, 1515, 1541, 1545, 1563, 1567, 1577, 1585, 1609, 1625, 1637, 1645, 1651, 1679, 1685, 1692, 1701, 1733, 1738, 1759
Offset: 1

Views

Author

N. J. A. Sloane, Sep 30 2001

Keywords

Comments

It can be shown that this sequence is monotonic.

Crossrefs

Cf. A064413, A064425. See A064955 for better version.

Programs

  • Mathematica
    terms = 100;
    ekg[s_] := Block[{m = s[[-1]], k = 3}, While[MemberQ[s, k] || GCD[m, k] == 1, k++]; Append[s, k]];
    EKG = Nest[ekg, {2, 4}, 12 terms];
    a[n_] := FirstPosition[EKG, Prime[n]][[1]];
    Array[a, terms] (* Jean-François Alcover, Sep 02 2018, after Robert G. Wilson v in A064413 *)

Extensions

More terms from Vladeta Jovovic, Oct 01 2001

A064669 Regard A064413 as giving a permutation of the positive integers; sequence gives (presumed) smallest term in each cycle of this permutation.

Original entry on oeis.org

1, 2, 3, 7, 8, 40, 64, 73, 101, 103, 121, 149, 223, 241, 251, 269, 331, 359, 383, 467, 499, 503, 509, 617, 673, 739, 773, 797, 823, 829, 1031, 1213, 1279, 1307, 1381, 1487, 1489, 1543, 1583, 1621, 1667, 1721, 1741, 1753, 1777, 1831, 1873, 1879
Offset: 1

Views

Author

N. J. A. Sloane, Oct 11 2001

Keywords

Examples

			Permutation has cycles (1) (2) (3, 4, 6, 9, 10, 5) ( ..., 20, 18, 12, 7, 14, 13, 28, 26, ...) (8) ...
		

Crossrefs

Showing 1-10 of 394 results. Next