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.

Previous Showing 11-20 of 31 results. Next

A318665 Denominators of the sequence whose Dirichlet convolution with itself yields A064664, the inverse permutation of EKG-sequence.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 1, 8, 2, 1, 2, 1, 2, 1, 1, 2, 8, 2, 2, 1, 2, 2, 2, 2, 2, 16, 2, 2, 4, 2, 2, 2, 2, 2, 8, 2, 2, 2, 1, 1, 4, 2, 1, 8, 2, 2, 2, 2, 1, 4, 1, 1, 16, 2, 2, 4, 2, 2, 4, 2, 2, 8, 1, 1, 4, 1, 2, 4, 1, 1, 8, 1, 2, 4, 2, 1, 4, 2, 1, 128, 2, 1, 4, 2, 2, 4, 1, 2, 16, 2, 2, 4, 2, 1, 4, 1, 1, 2, 8, 2, 4, 2, 2, 4
Offset: 1

Views

Author

Antti Karttunen, Sep 01 2018

Keywords

Crossrefs

Cf. A064664, A304526, A304527, A318664 (numerators).

Programs

  • PARI
    v064413 = readvec("b064413_upto65539_terms_only.txt"); \\ From b-file of A064413 prepared previously.
    A064413(n) = v064413[n];
    m064664 = Map();
    for(n=1,65539,mapput(m064664,A064413(n),n));
    A064664(n) = mapget(m064664,n);
    up_to = (2^14);
    DirSqrt(v) = {my(n=#v, u=vector(n)); u[1]=1; for(n=2, n, u[n]=(v[n]/v[1] - sumdiv(n, d, if(d>1&&dA317937.
    v318664_65 = DirSqrt(vector(up_to, n, A064664(n)));
    A318664(n) = numerator(v318664_65[n]);
    A318665(n) = denominator(v318664_65[n]);

Formula

a(n) = denominator of f(n), where f(1) = 1, f(n) = (1/2) * (A064664(n) - Sum_{d|n, d>1, d 1.

A278264 Least number with the same prime signature as the n-th term in the inverse of EKG-sequence: a(n) = A046523(A064664(n)).

Original entry on oeis.org

1, 2, 2, 2, 6, 4, 6, 8, 6, 4, 12, 2, 12, 2, 2, 2, 6, 12, 2, 12, 6, 2, 2, 16, 24, 8, 6, 6, 6, 2, 2, 2, 6, 32, 4, 30, 2, 36, 2, 24, 6, 6, 16, 2, 6, 30, 2, 12, 12, 6, 6, 2, 36, 48, 2, 4, 6, 24, 2, 12, 6, 60, 6, 64, 24, 2, 128, 6, 12, 6, 6, 12, 30, 30, 6, 2, 30, 30, 2, 72, 12, 2, 96, 6, 60, 48, 6, 2, 2, 2, 6, 6, 6, 24, 6, 6, 30, 12, 96, 6, 24, 6, 2, 6, 2, 12, 6
Offset: 1

Views

Author

Antti Karttunen, Nov 16 2016

Keywords

Comments

This sequence works as a "sentinel" for the inverse of EKG-sequence by matching to any other sequence that is obtained as f(A064664(n)), where f(n) is any function that depends only on the prime signature of n (see the index entry for "sequences computed from exponents in ..."). As of Nov 11 2016 no such sequences were present in the database.
Terms and b-file computed from b-file of A064664 provided by T. D. Noe and Ray Chandler.

Crossrefs

Programs

Formula

a(n) = A046523(A064664(n)).

A304753 Permutation of natural numbers: a(1) = 1; a(n) = A064413(1+A064664(n-1)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 29 2018

Keywords

Crossrefs

Cf. A304754 (inverse).

Formula

a(1) = 1; for n > 1, a(n) = A064413(1+A064664(n-1)).

A304754 Permutation of natural numbers: a(1) = 1; a(n) = 1+A064413(A064664(n)-1).

Original entry on oeis.org

1, 2, 7, 3, 11, 5, 15, 13, 4, 9, 23, 10, 27, 19, 6, 25, 35, 16, 39, 17, 8, 21, 47, 22, 31, 29, 34, 36, 59, 28, 63, 37, 12, 33, 26, 40, 75, 43, 14, 46, 83, 52, 87, 41, 58, 45, 95, 70, 57, 49, 18, 51, 107, 53, 61, 55, 20, 71, 119, 64, 123, 67, 50, 73, 56, 88, 135, 65, 24, 66, 143, 94, 147, 69, 112, 79, 85, 76, 159, 77, 124, 81, 167, 82, 91, 89, 30
Offset: 1

Views

Author

Antti Karttunen, May 29 2018

Keywords

Crossrefs

Cf. A304753 (inverse).

Formula

a(1) = 1; for n > 1, a(n) = 1+A064413(A064664(n)-1).

A327867 Even bisection of Möbius transform of A064664, the inverse of EKG-sequence.

Original entry on oeis.org

1, 1, -2, 5, -2, 2, -2, 9, 7, 8, -2, 4, -2, 12, 15, 14, -2, 15, -2, 17, 23, 21, -2, 20, 23, 19, 20, 18, -2, 18, -2, 33, 41, 32, 33, 24, -2, 34, 44, 23, -2, 27, -2, 33, 25, 44, -2, 32, 43, 31, 64, 42, -2, 32, 53, 46, 67, 48, -2, 32, -2, 60, 39, 58, 62, 40, -2, 62, 90, 44, -2, 44, -2, 78, 37, 70, 51, 55, -2, 58, 47, 84, -2, 50
Offset: 1

Views

Author

Antti Karttunen, Sep 30 2019

Keywords

Crossrefs

Formula

a(n) = A304526(2*n).
a(p) = -2 for all odd primes p.

A383258 LCM-transform of A064664 (the inverse of the EKG-sequence).

Original entry on oeis.org

1, 2, 5, 3, 1, 2, 7, 2, 1, 3, 1, 1, 1, 13, 11, 17, 1, 1, 37, 1, 1, 19, 43, 2, 1, 3, 1, 1, 1, 23, 61, 31, 1, 2, 5, 1, 67, 1, 29, 1, 1, 1, 3, 41, 1, 1, 89, 1, 1, 1, 1, 47, 1, 1, 53, 7, 1, 1, 107, 1, 1, 1, 1, 2, 1, 59, 2, 1, 1, 1, 1, 1, 1, 1, 1, 71, 1, 1, 151, 1, 1, 73, 1, 1, 1, 1, 1, 79, 167, 83, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 197
Offset: 1

Views

Author

Antti Karttunen, Apr 21 2025

Keywords

Comments

As the sequence A064664 has no S-property defined in the comments of A368900, therefore this is not equal to A014963(A064664(n)).

Crossrefs

Formula

a(n) = lcm {1..A064664(n)} / lcm {1..A064664(n-1)}.

A304528 Restricted growth sequence transform of A304526, which is Möbius transform of A064664, the inverse of EKG-sequence.

Original entry on oeis.org

1, 1, 2, 1, 3, 4, 5, 6, 1, 4, 7, 8, 9, 4, 10, 3, 11, 12, 13, 14, 10, 4, 15, 2, 16, 4, 17, 18, 19, 20, 21, 16, 10, 4, 8, 20, 22, 4, 10, 23, 24, 25, 26, 27, 9, 4, 28, 29, 13, 25, 10, 7, 30, 29, 31, 32, 10, 4, 33, 32, 34, 4, 35, 36, 23, 37, 38, 11, 10, 36, 39, 31, 40, 4, 41, 42, 43, 41, 44, 25, 45, 4, 46, 9, 15, 4, 10, 36, 47, 48, 49, 41, 10, 4, 50, 11, 51
Offset: 1

Views

Author

Antti Karttunen, May 18 2018

Keywords

Crossrefs

Programs

  • PARI
    \\ Needs also code for A064664 and A304526:
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    write_to_bfile(1,rgs_transform(vector(32768,n,A304526(n))),"b304528.txt");

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

A255582 a(n)=n when n <= 3, otherwise a(n) is the smallest positive number not yet in the sequence such that gcd(a(n), a(n-1)) <= gcd(a(n), a(n-2)) > 1.

Original entry on oeis.org

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

Views

Author

Bob Selcoe, Feb 26 2015

Keywords

Comments

This is a permutation of the natural numbers: the proof for A098550 applies with essentially no changes. [Confirmed by N. J. A. Sloane, Feb 27 2015]
For n > 3, all primes first appear in order as composites with one smaller prime (proof similar to that in A098550).
For any given set S of primes, the subsequence consisting of numbers whose prime factors are exactly the primes in S appears in increasing order. For example, if S = {2,3}, 6 appears first, followed by 12, 18, 24, 36, 48, 54, 72, etc.
Appears to be very similar to A064413. Compare the respective inverses A255479 and A064664; see also A255482. Speaking very loosely, the ratio a(n)/n seems to be about 1/2, 1, or 3/2, just as for A064413, although this is a long way from being proved for either sequence. David Applegate points out that this is (presumably) because primes p >= 13 always occur as part of a subsequence 2p X p Y 3p, and subsequences 2p X p Y 5p, 2p X p Y 7p, etc. that produced the extra curves in the graph of A098550 just do not happen. - N. J. A. Sloane, Feb 27 2015, Mar 05 2015.
First differs from A254077 at a(29). - Omar E. Pol, May 21 2015

Crossrefs

A255479 is the inverse permutation.
A256424 is a smoothed version.
A256529 gives the partial sums.

Programs

  • Haskell
    import Data.List (delete)
    a255582 n = a255582_list !! (n-1)
    a255582_list = 1 : 2 : 3 : f 2 3 [4..] where
       f u v ws = y : f v y (delete y ws) where
                  y = head [z | z <- ws, let d = gcd u z, d > 1, gcd v z <= d]
    -- Reinhard Zumkeller, Mar 10 2015
  • Mathematica
    a[n_] := a[n] = If[n<5, n, For[k=5, True, k++, If[FreeQ[Array[a, n-1], k], If[GCD[k, a[n-2]]>1 && GCD[k, a[n-1]] <= GCD[k, a[n-2]], Return[k]]]]];
    Array[a, 100] (* Jean-François Alcover, Jul 31 2018 *)

Extensions

a(41)-a(67) from Hiroaki Yamanouchi, Feb 27 2015
Previous Showing 11-20 of 31 results. Next