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

A082745 Duplicate of A064955.

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
Offset: 1

Views

Author

Keywords

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

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

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

A379296 First differences of A379290.

Original entry on oeis.org

7, 4, 29, 46, 6, 139, 8, 171, 239, 8, 10, 500, 6, 12, 822, 6, 6, 124, 6, 6, 6, 6, 1211, 1839, 8, 6, 6, 6, 6, 6, 168, 5546, 8, 24, 122, 6, 14, 6, 6, 6, 6, 6, 3109, 6, 10, 4565, 6, 34, 574, 6, 34, 6, 6, 6, 6, 6, 6, 11195, 6, 36, 6, 6, 426, 418, 8, 42, 10068, 8, 8, 6, 6, 6, 6, 25229, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 686, 6, 64, 6, 6, 6, 6, 394, 22241, 8, 6
Offset: 1

Views

Author

Scott R. Shannon, Dec 20 2024

Keywords

Comments

These are the differences between the indices where the prime terms appear in A379248. See that sequence for further details. Note the long runs of 6 - see the example below.

Examples

			A379248(1169) = 41, A379248(1175) = 43, with a difference in indices of 6. Worth noting is the values of the terms in this, and similar, ranges:
.
.
A379248(1167) = 943 = 23*41 , the lowest unseen multiple of 23.
A379248(1168) = 1681 = 41^2.
A379248(1169) = 41.
A379248(1170) = 3362 = 2*41^2 , which shows the pattern of p^2 -> p -> 2*p^2.
A379248(1171) = 697 = 17*41 , the lowest unseen multiple of 17.
A379248(1172) = 2023 = 7*17^2 , the lowest unseen multiple of 17^2.
A379248(1173) = 731 = 17*43, the lowest unseen multiple of 17.
A379248(1174) = 1849 = 43^2.
A379248(1175) = 43.
.
.
		

Crossrefs

A139476 Positions of squares in the EKG sequence (A064413).

Original entry on oeis.org

1, 3, 6, 17, 24, 30, 50, 64, 76, 86, 124, 136, 171, 180, 209, 240, 290, 303, 359, 385, 417, 436, 521, 547, 595, 643, 696, 747, 823, 850, 947, 982, 1022, 1102, 1171, 1234, 1313, 1381, 1453, 1525, 1642, 1688, 1810, 1855, 1931, 2033, 2168, 2203
Offset: 1

Views

Author

Zak Seidov, May 10 2008

Keywords

Comments

Conjecture: the squares appear in increasing order.
It appears after inspecting 40000 terms that all the n-th powers (squares, cubes, etc.) appear in increasing order. - Jacques Tramu, May 10 2008
The conjecture is false; in the EKG sequence, 158^2 is at position 24142, but 157^2 is at position 24146. Note that 157 is prime. If we let p=157, then the two terms on either side of p^2 are p(p+2) and p(p+3), which is unusual because for all primes 3 < p < 157, the three terms are p(p+1), p^2, p(p+2). The next unusual prime is 661. There are no others less than 8164.

Examples

			The position of 2^2 = 4 is 3 - the second term in the sequence.
The position of 3^2 = 9 is 6 - the third term in the sequence.
		

Crossrefs

Extensions

Edited by N. J. A. Sloane, Aug 06 2008

A379290 Index where prime(n) appears as a term in A379248.

Original entry on oeis.org

2, 9, 13, 42, 88, 94, 233, 241, 412, 651, 659, 669, 1169, 1175, 1187, 2009, 2015, 2021, 2145, 2151, 2157, 2163, 2169, 3380, 5219, 5227, 5233, 5239, 5245, 5251, 5257, 5425, 10971, 10979, 11003, 11125, 11131, 11145, 11151, 11157, 11163, 11169, 11175, 14284, 14290, 14300, 18865, 18871, 18905, 19479, 19485, 19519, 19525, 19531, 19537, 19543, 19549
Offset: 1

Views

Author

Scott R. Shannon, Dec 20 2024

Keywords

Comments

See A379248 for further details.

Crossrefs

Cf. A379248, A379291, A379296 (first differences), A064413, A064955.

A064957 Where the odd terms appear in A064413.

Original entry on oeis.org

1, 5, 6, 10, 11, 14, 15, 20, 21, 22, 24, 25, 28, 29, 33, 34, 37, 38, 39, 43, 44, 50, 51, 53, 54, 57, 58, 61, 62, 67, 68, 69, 74, 75, 76, 78, 81, 82, 84, 85, 89, 90, 93, 96, 97, 100, 101, 107, 108, 109, 111, 112, 115, 116, 118, 119, 124, 125, 128, 129
Offset: 1

Views

Author

N. J. A. Sloane, Oct 30 2001

Keywords

Comments

Complement of A064953; A195376(a(n)) = 1. [Reinhard Zumkeller, Sep 17 2001]

Crossrefs

Programs

A304527 Difference between A064664 (the inverse of EKG-sequence) and its Möbius-transform.

Original entry on oeis.org

0, 1, 1, 2, 1, 6, 1, 3, 5, 11, 1, 5, 1, 15, 14, 8, 1, 5, 1, 10, 18, 21, 1, 12, 10, 29, 6, 14, 1, 8, 1, 17, 24, 34, 23, 15, 1, 38, 32, 23, 1, 12, 1, 20, 12, 44, 1, 25, 14, 23, 37, 28, 1, 28, 29, 31, 41, 58, 1, 34, 1, 62, 16, 31, 37, 18, 1, 33, 47, 22, 1, 39, 1, 68, 25, 37, 33, 26, 1, 49, 22, 75, 1, 50, 42, 82, 61, 46, 1, 58, 41, 43, 65, 90, 46, 59, 1
Offset: 1

Views

Author

Antti Karttunen, May 18 2018

Keywords

Crossrefs

Programs

  • PARI
    A304527(n) = -sumdiv(n, d, (dA064664(d));

Formula

a(n) = A064664(n) - A304526(n).
a(n) = Sum_{d|n, dA304526(d).
a(n) = -Sum_{d|n, dA008683(n/d)*A064664(d).
For n >= 2, a(2*A000040(n))-1 = a(4*A000040(n)) = A064955(n). - Antti Karttunen, Dec 04 2022

A379291 Index where prime(n) first appears as a factor of a term in A379248.

Original entry on oeis.org

2, 4, 6, 16, 18, 20, 27, 29, 38, 48, 50, 64, 66, 68, 71, 84, 106, 108, 113, 117, 119, 130, 133, 139, 161, 171, 173, 177, 179, 183, 205, 209, 214, 216, 224, 226, 273, 277, 281, 284, 289, 303, 310, 312, 316, 318, 364, 384, 386, 388, 392, 396, 398, 431, 437, 441, 458, 460, 462, 464, 468, 476, 500, 504, 506, 508, 549, 553, 559, 563, 565, 585, 589, 594, 599, 603
Offset: 1

Views

Author

Scott R. Shannon, Dec 20 2024

Keywords

Comments

See A379248 for further details.

Crossrefs

Showing 1-10 of 19 results. Next