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

A261314 Rocket Sequence 34: a(0)=34, a(n) = A073846(a(n-1)).

Original entry on oeis.org

34, 59, 44, 79, 56, 107, 75, 54, 103, 72, 151, 102, 233, 153, 104, 239, 156, 397, 253, 165, 112, 263, 171, 116, 271, 176, 457, 290, 829, 512, 1619, 974, 3469, 2044, 8123, 4696, 20879, 11861, 6807, 3952, 17159, 9786, 47459
Offset: 0

Views

Author

Chayim Lowen, Aug 14 2015

Keywords

Comments

A073846(n) is defined as follows: if n = 2m for some integer m, A073846(n) is the m-th prime, if n = 2m-1 for some integer m, A073846(n) is the m-th nonprime.
Consider the (totally) ordered set {n, A073846(n), A073846(A073846(n))...} and let us append to this the ordered set {...b(b(b(n))),b(b(n)),b(n)} where b(m) = A073898(m) is the inverse of A073846. Let us call the result R#(n). It is clear that if m is a value in R#(n), R#(m) is just R#(n) with a different offset. Therefore, unless there is a need to do otherwise, let us denote each sequence by its lowest value. {a(n)} when extended to all integers (the last few unlisted values are ... 36, 61, 45, 34) is R#(34).
A given sequence c(n) can be one of two kinds. It can either be periodic with c(m) = c(0) for some m, or it can include infinitely many distinct values. R#(n) is finite for all n<34. However, this sequence has been checked up to a(86) = 1091595086717 without reaching 34. Instead it seems to be slowly climbing in value in both the negative and positive directions. Hence, its period is either extremely large or nonexistent (infinite). I conjecture that the latter is the case. Thus I dubbed the sequence "Rocket" because, as opposed to the "Hailstone" sequences, it never seems to "fall".

Examples

			a(1) = A073846(a(0)) = A073846(34) = 59.
		

Crossrefs

Cf. A073846.

Programs

  • Mathematica
    f[n_, lim_] := Block[{p = Prime@ Range@ PrimePi@ lim, c, s, a = {34}}, c = Complement[Range@ lim, p]; s = Riffle[Take[c, Length@ p], p]; Do[AppendTo[a, s[[a[[k]]]]], {k, n}]; a]; f[48, 10000000] (* Michael De Vlieger, Aug 26 2015, after Harvey P. Dale at A073846 *)

Formula

a(n+1) = A073846(a(n)) = A018252(ceiling(a(n)/2))*A000035(a(n)) + A000040(ceiling(a(n)/2))*A059841(a(n)).
a(n-1) = A073898(a(n)) = 2*A010051(a(n))*A000720(a(n)) + (1-A010051(a(n)))*(2*A018252(a(n))-1).

A261621 Rocket Sequence 42: a(0) = 42, a(n) = A073846(a(n-1)).

Original entry on oeis.org

42, 73, 52, 101, 70, 149, 100, 229, 150, 379, 243, 159, 108, 251, 164, 421, 267, 174, 449, 286, 823, 508, 1609, 968, 3461, 2040, 8111, 4689, 2745, 1631, 981, 600, 1987, 1189, 723, 448, 1423, 861, 530, 1697, 1020, 3643, 2146, 8623, 4978, 22193, 12602, 62791
Offset: 0

Views

Author

Chayim Lowen, Sep 09 2015

Keywords

Comments

This sequence has been checked up to a(108) = 106838266736 without reaching 42. It seems to be slowly climbing in value in both the negative and positive directions. Its period is either extremely large or more probably infinite.

Examples

			a(1) = A073846(a(0)) = A073846(42) = 73.
		

Crossrefs

Formula

a(n+1) = A073846(a(n)).
a(n-1) = A073898(a(n)).

A262149 Rocket sequence 50: a(0)=50, a(n)=A073846(a(n-1)).

Original entry on oeis.org

50, 97, 68, 139, 94, 211, 140, 349, 222, 607, 378, 1129, 689, 427, 272, 769, 476, 1493, 901, 552, 1783, 1072, 3863, 2268, 9151, 5275, 3077, 1819, 1092, 3931, 2308, 9323, 5370, 24113, 13671, 7825, 4528, 20021, 11385, 6537, 3796, 16363, 9336, 44927, 25250
Offset: 0

Views

Author

Chayim Lowen, Sep 12 2015

Keywords

Comments

This sequence has been checked up to a(98) = 1078406742163 without reaching 50. It seems to be slowly climbing in value in both the negative and positive directions. Hence, its period is either extremely large or, as I conjecture, infinite. Thus I dubbed the sequence "Rocket" because, as opposed the "Hailstone" sequences, it never seems to "fall".
This sequence, when extended to all integers using a(n-1) = A073898(a(n)), is R#(50), see A073846 for definition. - Chayim Lowen, Jan 25 2016

Examples

			a(1) = A073846(a(0)) = A073846(50) = 97.
		

Crossrefs

Programs

  • Mathematica
    s = Module[{p = Prime@ Range@ PrimePi@ #, c}, c = Complement[Range@ #, p]; Riffle[Take[c, Length@ p], p]] &[5*10^5]; NestList[s[[#]] &, 50, 44] (* Michael De Vlieger, Jan 27 2016, after Harvey P. Dale at A073846 *)

Formula

a(n+1) = A073846(a(n)).
a(n-1) = A073898(a(n)).

Extensions

Missing term 1092 inserted by Chayim Lowen, Mar 26 2017

A263570 Smallest positive integer such that n iterations of A073846 are required to reach an even number.

Original entry on oeis.org

2, 3, 17, 31, 163, 353, 721, 1185, 1981, 3363, 5777, 10039, 29579, 52737, 94705, 171147, 311101, 568431, 1043463, 1923619, 3559911, 6611675, 12319517, 23023727, 651267929, 1234823707, 2345409699, 4462239583, 8502848523, 16226083005, 31007327791, 59331187155
Offset: 0

Views

Author

Chayim Lowen, Oct 21 2015

Keywords

Comments

A number is considered to be its own zeroth iteration.
Is the sequence defined for all n? If so, are there infinitely many composite numbers? If not, are infinitely many a(n) defined?
From Hartmut F. W. Hoft, Apr 05 2016: (Start)
Numbers a(6)...a(11) and a(12)...a(23) each belong to iteration sequences that start with prime numbers 10039 and 23023727, respectively, while the other numbers in the sequences are composite.
For the entire iteration sequences and computation of the additional numbers for this sequence see A271363. (End)
For n>1, a(n) is the least integer k such that the repeated application of x -> A073846(x) strictly decreases exactly n times in a row. - Hugo Pfoertner and Michel Marcus, Mar 11 2021

Examples

			a(2)=17 because A073846(17) = 15, A073846(15) = 14; thus it took two steps whereas no smaller positive integer has this property.
		

Crossrefs

Programs

  • Mathematica
    (* Since A073846(9)=9, search starts with 11 *)
    c25000000 = Select[Range[25000000], CompositeQ];
    a073846[n_] := c25000000[[Floor[n/2]]]
    a073846Nest[n_] := Length[NestWhileList[a073846, n, OddQ]]
    a263570[n_] := Module[{list={2, 3}, i, length}, For[i=11, i<=n, i+=2, length=a073846Nest[i]; If[Length[list]Hartmut F. W. Hoft, Apr 05 2016 *)

Formula

For n>0, a(n+1) >= A073898(b(a(n))), where b(m) is the smallest odd composite not smaller than m, equality always holds if a(n) is composite.

Extensions

a(24)-a(31) from Hartmut F. W. Hoft, Apr 05 2016

A093458 Partial products of A073846.

Original entry on oeis.org

1, 2, 8, 24, 144, 720, 5760, 40320, 362880, 3991680, 39916800, 518918400, 6227020800, 105859353600, 1482030950400, 28158588057600, 422378820864000, 9714712879872000, 155435406077952000, 4507626776260608000
Offset: 0

Views

Author

Amarnath Murthy, Apr 03 2004

Keywords

Comments

a(n-2) is the number of elements in the largest conjugacy class of A_n, the alternating group on n letters. Cf. A059171. [Geoffrey Critzer, Mar 26 2013]

Crossrefs

Programs

  • Mathematica
    g[list_]:=Total[list]! / Apply[Times,list] / Apply[Times,Table[Count[list,n]!,{n,1,20}]];
    f[list_]:=Apply[Plus,Table[Count[list,n],{n,2,20,2}]];
    Drop[Table[Max[Map[g,Select[Partitions[n],EvenQ[f[#]]&]]],{n,1,20}]]
    (* Geoffrey Critzer, Mar 26 2013 *)

Formula

a(n) = prime(1) * composite(1) * prime(2) * composite(2) * ... * prime(n/2) * composite(n/2) if n is even else a(n) = prime(1) * composite(1) * prime(2) * composite(2) * ... * prime((n+1)/2). a(0) = 1.

Extensions

More terms from David Wasserman, Sep 28 2006

A227413 a(1)=1, a(2n)=nthprime(a(n)), a(2n+1)=nthcomposite(a(n)), where nthprime = A000040, nthcomposite = A002808.

Original entry on oeis.org

1, 2, 4, 3, 6, 7, 9, 5, 8, 13, 12, 17, 14, 23, 16, 11, 10, 19, 15, 41, 22, 37, 21, 59, 27, 43, 24, 83, 35, 53, 26, 31, 20, 29, 18, 67, 30, 47, 25, 179, 58, 79, 34, 157, 54, 73, 33, 277, 82, 103, 40, 191, 62, 89, 36, 431, 114, 149, 51, 241, 75, 101, 39, 127, 46
Offset: 1

Views

Author

Antti Karttunen, Jul 10 2013

Keywords

Comments

Inverse permutation of A135141.
Shares with A073846 the property that the other bisection consists of just primes and the other bisection of just nonprimes.

Crossrefs

Similarly constructed permutations: A227402, A227404, A227410, A227412. Cf. also A073846, A209636.

Programs

  • Haskell
    import Data.List (transpose)
    a227413 n = a227413_list !! (n-1)
    a227413_list = 1 : concat (transpose [map a000040 a227413_list,
                                          map a002808 a227413_list])
    -- Reinhard Zumkeller, Jan 29 2014

Formula

a(1)=1, a(2n) = A000040(a(n)), a(2n+1) = A002808(a(n)).
A007097(n) = a(A000079(n)).

A073898 a(1) = 1; for n>1, a(n) = smallest even or odd number not occurring earlier accordingly as n is prime or composite.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 8, 7, 9, 11, 10, 13, 12, 15, 17, 19, 14, 21, 16, 23, 25, 27, 18, 29, 31, 33, 35, 37, 20, 39, 22, 41, 43, 45, 47, 49, 24, 51, 53, 55, 26, 57, 28, 59, 61, 63, 30, 65, 67, 69, 71, 73, 32, 75, 77, 79, 81, 83, 34, 85, 36, 87, 89, 91, 93, 95, 38, 97, 99, 101, 40, 103
Offset: 1

Views

Author

Amarnath Murthy, Aug 18 2002

Keywords

Comments

Inverse of A073846. - Chayim Lowen, Oct 28 2015

Crossrefs

Programs

  • Maple
    A073898 :=proc(nmax) local a,n,k; a := [1] ; while nops(a) < nmax do n := nops(a)+1 ; if isprime(n) then k :=2; else k :=1; fi ; while k in a do k := k+2 ; od ; a := [op(a),k] ; od ; RETURN(a) ; end: op(A073898(80)) ; # R. J. Mathar, Jun 27 2007
  • Mathematica
    Table[(4 PrimePi[n] - 2 n - 1)*(PrimePi[n] - PrimePi[n - 1]) + 2 (n - PrimePi[n - 1]) - 1, {n, 72}] (* Michael De Vlieger, Nov 11 2015 *)
  • PARI
    vector(100, n, (4*primepi(n)-2*n-1)*(primepi(n)-primepi(n-1))+2*(n-primepi(n-1))-1) \\ Altug Alkan, Oct 29 2015

Formula

a(n) = (4*pi(n)-2*n-1)*(pi(n)-pi(n-1)) + 2*(n - pi(n-1)) - 1, where pi = A000720. - Robert Israel, Oct 28 2015

Extensions

Corrected and extended by R. J. Mathar, Jun 27 2007

A088610 Starting with n = 1, a(n) is the smallest squarefree number not included earlier if n is odd, else n is the smallest nonsquarefree number.

Original entry on oeis.org

1, 4, 2, 8, 3, 9, 5, 12, 6, 16, 7, 18, 10, 20, 11, 24, 13, 25, 14, 27, 15, 28, 17, 32, 19, 36, 21, 40, 22, 44, 23, 45, 26, 48, 29, 49, 30, 50, 31, 52, 33, 54, 34, 56, 35, 60, 37, 63, 38, 64, 39, 68, 41, 72, 42, 75, 43, 76, 46, 80, 47, 81, 51, 84, 53, 88, 55, 90, 57, 92, 58, 96
Offset: 1

Views

Author

Amarnath Murthy, Oct 16 2003

Keywords

Comments

From Antti Karttunen, Jun 04 2014: (Start)
Squarefree (A005117) and nonsquarefree numbers (A013929) interleaved, the former at odd n and the latter at even n.
A243344 is a a "recursivized" variant of this permutation. Like this one, it also satisfies the given simple identity linking the parity of n with the Moebius mu-function. (End)

Crossrefs

Inverse: A243352.
Bisections: A005117, A013929.

Programs

  • Mathematica
    With[{max = 100}, s = Select[Range[max], SquareFreeQ]; ns = Complement[Range[max], s]; Riffle[s[[1 ;; Length[ns]]], ns]] (* Amiram Eldar, Mar 04 2024 *)
  • Scheme
    (define (A088610 n) (if (even? n) (A013929 (/ n 2)) (A005117 (/ (+ 1 n) 2))))

Formula

From Antti Karttunen, Jun 04 2014: (Start)
a(2n) = A013929(n), a(2n-1) = A005117(n).
For all n, A008966(a(n)) = A000035(n), or equally, mu(a(n)) = n modulo 2, where mu is Moebius mu (A008683). (End)

Extensions

More terms from Ray Chandler, Oct 18 2003

A115316 Lexicographically earliest permutation of the natural numbers such that each prime number is followed by exactly two composite numbers.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jan 20 2006

Keywords

Comments

Inverse: A115318.
Fixed points = {1,2,27,28,29,30,33,34}, also for A115317, A115318, A115319.

Crossrefs

Programs

  • Mathematica
    terms = 72;
    np = Ceiling[terms/3] + 1;
    nc = Ceiling[(2/3) terms];
    pp = Prime[Range[np]];
    cc = Partition[Select[Range[FindRoot[n == nc + PrimePi[n] + 1, {n, nc, 2nc}][[1, 2]] // Floor], CompositeQ], 2];
    Join[{1}, Riffle[pp, cc] // Flatten][[1 ;; terms]] (* Jean-François Alcover, Nov 15 2021 *)

Formula

a(a(n)) = A115317(n).
a(3*n-2) = A018252(2*n-1), a(3*n-1) = A000040(n), a(3*n) = A018252(2*n);
a(n+1+floor((n+1)/2)) = A002808(n).

A237056 Ludic and non-ludic numbers interleaved.

Original entry on oeis.org

1, 4, 2, 6, 3, 8, 5, 9, 7, 10, 11, 12, 13, 14, 17, 15, 23, 16, 25, 18, 29, 19, 37, 20, 41, 21, 43, 22, 47, 24, 53, 26, 61, 27, 67, 28, 71, 30, 77, 31, 83, 32, 89, 33, 91, 34, 97, 35, 107, 36, 115, 38, 119, 39, 121, 40, 127, 42, 131, 44, 143, 45, 149, 46, 157
Offset: 1

Views

Author

Keywords

Comments

a(2*n-1) = A003309(n); a(2*n) = A192607(n);
integer permutation with inverse A237058.

Crossrefs

Cf. A073846.

Programs

  • Haskell
    import Data.List (transpose)
    a237056 n = a237056_list !! (n-1)
    a237056_list = concat $ transpose [a003309_list, a192607_list]
  • Mathematica
    a3309[nmax_] := a3309[nmax] = Module[{t = Range[2, nmax], k, r = {1}}, While[Length[t] > 0, k = First[t]; AppendTo[r, k]; t = Drop[t, {1, -1, k}]]; r];
    nmax = 1000;
    Riffle[a3309[nmax], Complement[Range[nmax], a3309[nmax]]] (* Jean-François Alcover, Dec 10 2021, after Ray Chandler in A003309 *)
Showing 1-10 of 18 results. Next