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-3 of 3 results.

A073846 a(1) = 1; thereafter, every even-indexed term is prime and every odd-indexed term is composite.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 8, 7, 9, 11, 10, 13, 12, 17, 14, 19, 15, 23, 16, 29, 18, 31, 20, 37, 21, 41, 22, 43, 24, 47, 25, 53, 26, 59, 27, 61, 28, 67, 30, 71, 32, 73, 33, 79, 34, 83, 35, 89, 36, 97, 38, 101, 39, 103, 40, 107, 42, 109, 44, 113, 45, 127, 46, 131, 48, 137, 49, 139, 50
Offset: 1

Views

Author

Amarnath Murthy, Aug 14 2002

Keywords

Comments

Equals A067747 shifted by one position. a(n) = A067747(n-1) [for n>1]. - R. J. Mathar, Apr 01 2007
From Chayim Lowen, Aug 12 2015: (Start)
Consider f(n,k) = a(f(n,k-1)) with f(n,0) = n. Let us also define f(n,k) for negative values of k as well using: f(n,k-1) = A073898(f(n,k)) where A073898(a(n)) = a(A073898(n)) = n. Let us denote the sequence {f(n,i)} for integers i by R#(n). It is clear that if a is a value in R#(b), R#(a) is just R#(b) with a different offset. Therefore, unless there is a need to do otherwise, let us denote each sequence by its lowest value. These sequences can only behave in one of two ways. They can either be periodic with f(n,m) = f(n,0) for some m, or they can include infinitely many distinct values. Here is the behavior of R#(n) for n<=100:
* R#(1), R#(2) and R#(9) are 1-cycles.
* R#(3), R#(5), R#(7), R#(10) and R#(12) are 2-cycles.
* R#(14), R#(62) and R#(84) are 3-cycles.
* R#(92) is a 6-cycle.
* R#(18) is a 22-cycle.
* R#(34) (A261314) has been checked up to f(34,86) = 1091595086717, R#(42) up to f(42,108) = 106838266736, R#(50) up to f(50,98) = 1078406742163, R#(60) up to f(60,80) = 765456394363, R#(74) up to f(74,78) = 687059343029, R#(82) up to f(82,75) = 682580868743 R#(86) up to f(86,74) = 182831963148, R#(88) up to f(88,66) = 719074799059, and R#(98) up to f(98,88) = 641383978721 without repeated values. Hence, their periods are either extremely large or nonexistent (infinite). I conjecture that the latter is the case. Note that these sequences are not necessarily all distinct as any two may simply be the same sequence with a large offset.
For all other n<=100, a(n) is included in one of the above sequences. (End)
Conjecturally, the integers that belong to one of these cycles are: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 37, 39, 41, 43, 47, 53, 62, 84, 87, 92, 121, 127, 132, 135, 181, 199, 205, 317. - Michel Marcus, Mar 07 2021

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a073846 n = a073846_list !! (n-1)
    a073846_list = concat $ transpose [a018252_list, a000040_list]
    -- Reinhard Zumkeller, Jan 29 2014
    
  • Maple
    N:= 100: # to get a(1) to a(2*N).
    p:= ithprime(N):
    P,NP:= selectremove(isprime,[$1..p]):
    seq(op([NP[i],P[i]]),i=1..N); # Robert Israel, Dec 22 2014
  • Mathematica
    Composite[n_Integer] := FixedPoint[n + PrimePi[ # ] + 1 &, n]; Join[{1}, Flatten[ Transpose[{Table[Prime[n], {n, 1, 35}], Table[Composite[n], {n, 1, 35}]}]]]
    f[upto_]:=Module[{prs=Prime[Range[PrimePi[upto]]],comps},comps= Complement[ Range[upto],prs];Riffle[Take[comps,Length[prs]],prs]]; f[150] (* Harvey P. Dale, Dec 03 2011 *)
  • PARI
    c(n) = for(k=0, primepi(n), isprime(n++)&&k--); n; \\ A002808
    a(n) = if (n==1, 1, if (n%2, c(n\2), prime(n/2))); \\ Michel Marcus, Mar 06 2021
    
  • Python
    from sympy import prime, composite
    def A073846(n): return 1 if n == 1 else (composite(n//2) if n % 2 else prime(n//2)) # Chai Wah Wu, Mar 09 2021

Formula

a(2*n-1) = A018252(n); a(2*n) = A000040(n). - Reinhard Zumkeller, Jan 29 2014
a(n) = A018252(ceiling(n/2))*A000035(n) + A000040(ceiling(n/2))*A059841(n), equivalent to Reinhard Zumkeller's formula. - Chayim Lowen, Jul 29 2015
a(2n)/a(2n-1) ~ log(n). - Thomas Ordowski, Sep 10 2015

Extensions

Edited by Robert G. Wilson v and Benoit Cloitre, Aug 16 2002

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
Showing 1-3 of 3 results.