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

A382222 Smallest k such that A073734(k) = n, where A073734 is the GCD of consecutive terms of the EKG sequence A064413.

Original entry on oeis.org

2, 3, 5, 8, 10, 968, 14, 17, 149, 579, 20, 11068, 28, 2126, 2406, 3070, 33, 58836, 37, 2935, 7468, 20029, 43, 50835, 321, 1065, 2220, 60390, 57, 403831, 61, 20143, 29156, 13453, 32294, 18829, 67, 2117, 56683, 65867, 74, 10242, 81, 82455, 80410, 24112, 89, 868283, 41341, 36370
Offset: 1

Views

Author

Scott R. Shannon, Mar 19 2025

Keywords

Comments

a(630) > 1.045*10^9.

Examples

			a(6) = 968 as A064413(968) = 1014, A064413(967) = 1032, and GCD(1014,1032) = 6. No earlier pair of consecutive terms in A064413 has a GCD of 6.
		

Crossrefs

Formula

If n = prime(j), j>=2, then a(n) = A064955(j).

A382271 Smallest k such that A073734(k) = 2^n, where A073734 is the GCD of consecutive terms of the EKG sequence A064413.

Original entry on oeis.org

2, 3, 8, 17, 3070, 20143, 46660, 187759, 1339550, 2692614, 81281233, 61760615, 98845851
Offset: 0

Views

Author

Keywords

Comments

a(13) > 1.045*10^9.

Examples

			a(3) = 17 as A064413(17) = 16, A064413(16) = 24, and GCD(16,24) = 8 = 2^3. No earlier pair of consecutive terms in A064413 has a GCD of 8.
		

Crossrefs

A380506 Smallest k such that A073734(k) is in A055932, where A073734 is the GCD of consecutive terms of the EKG sequence A064413.

Original entry on oeis.org

2, 3, 8, 968, 17, 11068, 3070, 58836, 50835, 403831, 20143, 18829, 868283, 458530, 245484, 46660, 199785, 5653022, 3603103, 477958, 2144637, 187759, 910595, 4181867, 1692138, 7454121, 10792662, 11232004, 36842536, 16878596, 1339550, 211463464, 3650538, 24922454
Offset: 1

Views

Author

Keywords

Comments

This is a sequence of "late comers" in A073734, that is, numbers with a primorial kernel.

Examples

			Let s = A055932.
Table of n, s(n), and a(n) for n = 1..18:
 n   s(n)       a(n)
--------------------
 1     1          2
 2     2          3
 3     4          8
 4     6        968
 5     8         17
 6    12      11068
 7    16       3070
 8    18      58836
 9    24      50835
10    30     403831
11    32      20143
12    36      18829
13    48     868283
14    54     458530
15    60     245484
16    64      46660
17    72     199785
18    90    5653022
		

Crossrefs

Cf. A002110, A055932, A064413, A073734, A382222 (superset), A382271 (proper subset).

Programs

  • Mathematica
    (* First, load function f from A055932, then generate a064413 using code in the links at that sequence *)
    a055932 = Union@ Flatten@ f[4];
    a073734 = Table[GCD[a064413[[n]], a064413[[n + 1]]], {n, Length[a064413] - 1}];
    TakeWhile[ Map[FirstPosition[a073734, #][[1]] &, a055932], IntegerQ]

A365899 Numbers k such that A073734(k) is neither squarefree nor a prime power.

Original entry on oeis.org

2935, 5446, 5910, 9093, 11068, 15713, 15795, 18829, 19984, 23669, 25794, 26386, 33619, 36370, 36498, 41560, 41779, 46911, 48184, 48231, 48604, 50349, 50835, 53082, 53253, 53760, 54758, 56524, 58144, 58836, 59600, 60390, 60533, 63181, 64979, 65226, 65867, 66449
Offset: 1

Views

Author

Michael De Vlieger, Sep 28 2023

Keywords

Comments

Subset of A073735.
A073734(a(n)) = GCD(A064413(a(n)-1), A064413(a(n))) is in A126706.

Examples

			Table of first terms and how they relate to b(n) = A073735(n) and EKG(n) = A064413(n).
   n   m=a(n)  b(m)          EKG(m-1)  EKG(m)
  -------------------------------------------
   1    2935    20 = 2*2*5      3080    3060
   2    5446    20              5740    5660
   3    5910    20              6180    6140
   4    9093    20              9460    9440
   5   11068    12 = 2*2*3     11484   11472
   6   15713    52 = 2*2*13    16328   16276
   7   15795    12             16368   16356
   8   18829    36 = 2*2*3*3   19548   19476
   9   19984    63 = 3*3*7     20727   20664
  10   23669   116 = 2*2*29    24592   24476
  11   25794    56 = 2*2*2*7   26712   26656
  12   26386    68 = 2*2*17    27472   27268
  ...
  30   58836    18 = 2*3*3     60786   60778
  ...
		

Crossrefs

A064413 EKG sequence (or ECG sequence): a(1) = 1; a(2) = 2; for n > 2, a(n) = smallest number not already used which shares a factor with a(n-1).

Original entry on oeis.org

1, 2, 4, 6, 3, 9, 12, 8, 10, 5, 15, 18, 14, 7, 21, 24, 16, 20, 22, 11, 33, 27, 30, 25, 35, 28, 26, 13, 39, 36, 32, 34, 17, 51, 42, 38, 19, 57, 45, 40, 44, 46, 23, 69, 48, 50, 52, 54, 56, 49, 63, 60, 55, 65, 70, 58, 29, 87, 66, 62, 31, 93, 72, 64, 68, 74, 37, 111, 75, 78, 76, 80, 82
Offset: 1

Views

Author

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

Keywords

Comments

Locally, the graph looks like an EKG (American English) or ECG (British English).
Calculating the square of A064413 and plotting the results shows the EKG behavior even more dramatically - see A104125. - Parthasarathy Nambi, Jan 27 2005
Theorem: (1) Every number appears exactly once: this is a permutation of the positive numbers. - J. C. Lagarias, E. M. Rains, N. J. A. Sloane, Oct 03 2001
The permutation has cycles (1) (2) (3, 4, 6, 9, 10, 5) (..., 20, 18, 12, 7, 14, 13, 28, 26, ...) (8) ...
Theorem: (2) The primes appear in increasing order. - J. C. Lagarias, E. M. Rains, N. J. A. Sloane, Oct 03 2001
Theorem: (3) When an odd prime p appears it is immediately preceded by 2p and followed by 3p. - Conjectured by Lagarias-Rains-Sloane, proved by Hofman-Pilipczuk.
Theorem: (4) Let a'(n) be the same sequence but with all terms p and 3p (p prime) changed to 2p (see A256417). Then lim a'(n)/n = 1, i.e., a(n) ~ n except for the values p and 3p for p prime. - Conjectured by Lagarias-Rains-Sloane, proved by Hofman-Pilipczuk.
Conjecture: If a(n) != p, then almost everywhere a(n) > n. - Thomas Ordowski, Jan 23 2009
Conjecture: lim #(a_n > n) / n = 1, i.e., #(a_n > n) ~ n. - Thomas Ordowski, Jan 23 2009
Conjecture: A term p^2, p a prime, is immediately preceded by p*(p+1) and followed by p*(p+2). - Vladimir Baltic, Oct 03 2001. This is false, for example the sequence contains the 3 terms p*(p+2), p^2, p*(p+3) for p = 157. - Eric Rains
Theorem: If a(k) = 3p, then |{a(m) : a(m>k) < 3p}| = 3p - k. Proof: If a(k) = 3p, then all a(mk) > p and |{a(m) : a(m>k) < 3p}| = 3p - k. - Thomas Ordowski, Jan 22 2009
Let ...,a_i,...,2p,p,3p,...,a_j,... There does not exist a_i > 3p. There does not exist a_j < p. - Thomas Ordowski, Jan 20 2009
Let...,a,...,2p,p,3p,...,b,... All a<3p and b>p. #(a>2p) <= #(b<2p). - Thomas Ordowski, Jan 21 2009
If a(k)=3p then |{a(m):a(m>k)<3p}|=3p-k. - Thomas Ordowski, Jan 22 2009
GCD(a(n),n) = A247379(n). - Reinhard Zumkeller, Sep 16 2014
If the definition is changed to require that the GCD of successive terms be a prime power > 1, the sequence stays the same until a(578)=620, at which point a(579)=610 has GCD = 10 with the previous term. - N. J. A. Sloane, Mar 30 2015
From Michael De Vlieger, Dec 06 2021: (Start)
For prime p > 2, we have the chain {j : 2|j} -> 2p -> p -> 3p -> {k : 3|k}. The term j introducing 2p must be even, since 2p is an even squarefree semiprime proved by Hofman-Pilipczuk to introduce p itself. Hence no term a(i) such that p | a(i) exists in the sequence for i < n-1, where a(n) = p, leaving 2|j. Similarly, the term k following 3p must be divisible by 3 since the terms mp that are not coprime to p (thus implying p | mp) have m >= 4, thereby large compared to numbers k such that 3|k that belong to the cototient of 3p. For the chain {4, 6, 3, 9, 12}, the term 12 following 3p indeed is 4p, but p = 3; this is the only case of 4p following 3p in the sequence. As a consequence, for i > 1, A073734(A064955(i)-1) = 2 and A073734(A064955(i)+2) = 3.
For Fermat primes p, we have the chain {j : 2|j} -> 2^e-> {2p = 2^e + 2} -> {p = 2^(e-1) + 1} -> 3p -> {k : 3|k}.
a(3) = 4 = 2^2, a(5) = 3 = 2^1 + 1;
a(8) = 8 = 2^3, a(10) = 5 = 2^2 + 1;
a(31) = 32 = 2^5, a(33) = 17 = 2^4 + 1;
a(485) = 512 = 2^9, a(487) = 257 = 2^8 + 1;
a(127354) = 131072 = 2^17, a(127356) = 65537 = 2^16 + 1.
(End)

Examples

			a(2) = 2, a(3) = 4 (gcd(2,4) = 2), a(4) = 6 (gcd(4,6) = 2), a(5) = 3 (gcd(6,3) = 3), a(6) = 9 (6 already used so next number which shares a factor is 9 since gcd(3,9) = 3).
		

References

  • N. J. A. Sloane, Seven Staggering Sequences, in Homage to a Pied Puzzler, E. Pegg Jr., A. H. Schoen and T. Rodgers (editors), A. K. Peters, Wellesley, MA, 2009, pp. 93-110.

Crossrefs

A073734 gives GCD's of successive terms.
See A064664 for the inverse permutation. See A064665-A064668 for the first two infinite cycles of this permutation. A064669 gives cycle representatives.
See A064421 for sequence giving term at which n appears.
See A064424, A074177 for records.
Cf. A064955 & A352194 (prime positions), A195376 (parity), A064957 (positions of odd terms), A064953 (positions of even terms), A064426 (first differences).
See A169857 and A119415 for the effect of changing the start.
Cf. A240024 (nonprime version).
Cf. A152458 (fixed points), A247379, A247383.
For other initial terms, see A169841, A169837, A169843, A169855, A169849.
A256417 is a smoothed version.
See also A255582, A256466, A257218, A257311-A257315, A257405, A253279 (two-dimensional analog).
See also A276127.

Programs

  • Haskell
    import Data.List (delete, genericIndex)
    a064413 n = genericIndex a064413_list (n - 1)
    a064413_list = 1 : f 2 [2..] 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
    -- Reinhard Zumkeller, May 01 2014, Sep 17 2011
    
  • Maple
    h := array(1..20000); a := array(1..10000); maxa := 300; maxn := 2*maxa; for n from 1 to maxn do h[n] := -1; od: a[1] := 2; h[2] := 1; c := 2; for n from 2 to maxa do for m from 2 to maxn do t1 := gcd(m,c); if t1 > 1 and h[m] = -1 then c := m; a[n] := c; h[c] := n; break; fi; od: od: ap := []: for n from 1 to maxa do ap := [op(ap),a[n]]; od: hp := []: for n from 2 to maxa do hp := [op(hp),h[n]]; od: convert(ap,list); convert(hp,list); # this is very crude!
    N:= 1000: # to get terms before the first term > N
    V:= Vector(N):
    A[1]:= 1:
    A[2]:= 2: V[2]:= 1:
    for n from 3 do
      S:= {seq(seq(k*p,k=1..N/p),p=numtheory:-factorset(A[n-1]))};
      for s in sort(convert(S,list)) do
        if V[s] = 0 then
          A[n]:= s;
          break
        fi
      od;
      if V[s] = 1 then break fi;
      V[s]:= 1;
    od:
    seq(A[i],i=1..n-1); # Robert Israel, Jan 18 2016
  • Mathematica
    maxN = 100; ekg = {1, 2}; unused = Range[3, maxN]; found = True; While[found, found = False; i = 0; While[ !found && i < Length[unused], i++; If[GCD[ekg[[-1]], unused[[i]]] > 1, found = True; AppendTo[ekg, unused[[i]]]; unused = Delete[unused, i]]]]; ekg (* Ayres *)
    ekGrapher[s_List] := Block[{m = s[[-1]], k = 3}, While[MemberQ[s, k] || GCD[m, k] == 1, k++ ]; Append[s, k]]; Nest[ekGrapher, {1, 2}, 71] (* Robert G. Wilson v, May 20 2009 *)
  • PARI
    a1=1; a2=2; v=[1,2];
    for(n=3,100,a3=if(n<0,0,t=1;while(vecmin(vector(length(v),i,abs(v[i]-t)))*(gcd(a2,t)-1)==0,t++);t);a2=a3;v=concat(v,a3););
    a(n)=v[n];
    /* Benoit Cloitre, Sep 23 2012 */
    
  • Python
    from math import gcd
    A064413_list, l, s, b = [1,2], 2, 3, {}
    for _ in range(10**5):
        i = s
        while True:
            if not i in b and gcd(i, l) > 1:
                A064413_list.append(i)
                l, b[i] = i, True
                while s in b:
                    b.pop(s)
                    s += 1
                break
            i += 1 # Chai Wah Wu, Dec 08 2014

Formula

a(n) = smallest number not already used such that gcd(a(n), a(n-1)) > 1.
In Lagarias-Rains-Sloane (2002), it is conjectured that almost all a(n) satisfy the asymptotic formula a(n) = n (1+ 1/(3 log n)) + o(n/log n) as n -> oo and that the exceptional terms when the sequence is a prime or 3 times a prime p produce the spikes in the sequence. See the paper for a more precise statement of the conjecture. - N. J. A. Sloane, Mar 07 2015

Extensions

More terms from Naohiro Nomoto, Sep 30 2001
Entry extensively revised by N. J. A. Sloane, Oct 10 2001

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)).

A064740 Smallest controlling prime when A064413(n) is computed.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 18 2001

Keywords

Crossrefs

Formula

a(n) = A020639(A073734(n)). - Michael De Vlieger, Dec 10 2021

Extensions

More terms from David Wasserman, Aug 05 2002

A073735 Numbers k such that the k-th term of the EKG sequence (A064413(k)) has more than one controlling prime.

Original entry on oeis.org

579, 968, 1065, 1221, 1428, 1604, 2092, 2117, 2126, 2236, 2406, 2872, 2935, 3048, 3330, 3496, 4085, 4194, 4434, 4697, 4887, 5148, 5446, 5846, 5910, 6484, 6846, 7355, 7448, 7468, 7773, 7939, 8324, 8746, 8923, 8957, 9018, 9093, 9369, 10242, 10318
Offset: 1

Views

Author

David Wasserman, Aug 06 2002

Keywords

Comments

These are the k such that A073734(k) is not a prime power.

Examples

			A064413(578) = 620, which is divisible by the primes 2, 5 and 31. So by definition, A064413(579) is the smallest number not already in A064413 that is divisible by 2, 5, or 31. This number is 610, which is divisible by both 2 and 5, so these are both called controlling primes of A064413(579).
		

Crossrefs

A336946 a(1) = 1; for n > 1, a(n) is the next square spiral number not already used such that a(n) shares a factor with a(n-1) and also with the adjacent number on the inner spiral arm if such a number exists.

Original entry on oeis.org

1, 2, 4, 6, 3, 9, 12, 8, 10, 5, 20, 14, 7, 28, 16, 18, 15, 21, 24, 22, 11, 33, 30, 25, 35, 40, 45, 36, 26, 42, 27, 63, 48, 32, 34, 50, 38, 54, 39, 51, 60, 44, 46, 66, 55, 65, 70, 49, 56, 52, 58, 72, 57, 76, 62, 78, 13, 117, 69, 75, 80, 64, 68, 74, 37, 148
Offset: 1

Views

Author

Scott R. Shannon, Aug 08 2020

Keywords

Comments

This is a variation of the EKG sequence A064413 where the numbers are written on the square spiral such that each new number must share a common factor with not only the previous number but also with the adjacent inner spiral number, in one of the four axial directions, if such a number exists. This additional restriction causes the numbers to violate some of the patterns the numbers form in the standard EKG sequence, e.g., an odd prime p does not need to be preceded by 2p or followed by 3p, and the primes do not appear in increasing order.
For the first 100000 terms the smallest unseen number is 433.

Examples

			The spiral begins
                                .
                                .
   38--50--34--32--48--63--27  78
    |                       |   |
   54  15--18--16--28---7  42  62
    |   |               |   |   |
   39  21   3---6---4  14  26  76
    |   |   |       |   |   |   |
   51  24   9   1---2  20  36  57
    |   |   |           |   |   |
   60  22  12---8--10---5  45  72
    |   |                   |   |
   44  11--33--30--25--35--40  58
    |                           |
   46--66--55--65--70--49--56--52
.
a(1)-a(8) = 1,2,4,6,3,9,12,8. The adjacent inner spiral number is 1 which all numbers share a factor with so the numbers are the same as A064413(n).
a(9) = 10. This is the first number that must have a common factor with two numbers, the previous number a(8) = 8 and the adjacent spiral number a(2) = 2. The lowest unused number satisfying this requirement is 10.
a(10) = 5. As this number is on the corner of a square spiral arm it only needs to share a divisor with a(9) = 10. The lowest unseen number satisfying this is 5.
a(11) = 20.  This number must have a common factor with the previous number a(10) = 5 and the adjacent spiral number a(2) = 2. The lowest unused number satisfying this requirement is 20. This is also the first number to differ from  A064413 which only needs to find the lowest unused number sharing a factor with 5, which is 15.
		

Crossrefs

A369302 a(n) = A091255(A369293(n), A369293(n+1)).

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 7, 7, 2, 2, 6, 3, 15, 3, 2, 4, 2, 11, 11, 3, 13, 13, 2, 3, 7, 7, 2, 2, 2, 3, 31, 31, 2, 7, 7, 2, 19, 19, 3, 5, 3, 25, 25, 2, 2, 3, 3, 3, 5, 7, 7, 4, 13, 3, 6, 3, 63, 3, 2, 4, 2, 14, 3, 61, 61, 2, 37, 37, 3, 3, 59, 59, 2, 2, 11, 11, 7, 7, 4, 2
Offset: 1

Views

Author

Rémy Sigrist, Jan 19 2024

Keywords

Comments

All terms, except the first, are > 1.

Examples

			a(42) = A091255(A369293(42), A369293(43)) = A091255(43, 25) = 25.
		

Crossrefs

Programs

  • PARI
    See Links section.
Showing 1-10 of 12 results. Next