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

A070983 Erroneous version of A078350.

Original entry on oeis.org

1, 1, 3, 1, 2, 3, 6, 1, 6, 2, 5, 3, 3, 6, 4, 1, 4, 6, 7, 2, 1, 5, 4, 3, 7, 3, 25, 6, 6, 4, 24, 1, 7, 4
Offset: 1

Views

Author

Keywords

A055509 Number of odd primes in sequence obtained in 3x+1 (or Collatz) problem starting at n.

Original entry on oeis.org

0, 0, 2, 0, 1, 2, 5, 0, 5, 1, 4, 2, 2, 5, 3, 0, 3, 5, 6, 1, 0, 4, 3, 2, 6, 2, 24, 5, 5, 3, 23, 0, 6, 3, 2, 5, 6, 6, 10, 1, 24, 0, 7, 4, 3, 3, 22, 2, 6, 6, 5, 2, 2, 24, 23, 5, 7, 5, 10, 3, 4, 23, 19, 0, 6, 6, 8, 3, 2, 2, 21, 5, 24, 6, 1, 6, 5, 10, 10, 1, 4, 24, 23, 0, 0, 7, 8, 4, 9, 3, 19, 3, 2, 22, 19
Offset: 1

Views

Author

G. L. Honaker, Jr., Jun 30 2000

Keywords

Crossrefs

Programs

  • Haskell
    a055509 n = sum $ map a010051 $ takeWhile (> 2) $ iterate a006370 n -- Reinhard Zumkeller, Oct 08 2011
    
  • Maple
    g:= proc(n) option remember;
       local x;
       x:= 3*n+1;
       x:= x/2^padic:-ordp(x,2);
       if isprime(n) then procname(x)+1 else procname(x) fi
    end proc:
    g(1):= 0:
    seq(g(n/2^padic:-ordp(n,2)),n=1..100); # Robert Israel, Dec 05 2017
  • Mathematica
    Join[{0}, Table[Count[NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &], ?PrimeQ] - 1, {n, 2, 94}]] (* _Jayanta Basu, Jun 15 2013 *)
  • PARI
    A078350(n,c=0)={while(1>=valuation(n,2), isprime(n)&&c++; n=n*3+1);c} \\ M. F. Hasler, Dec 05 2017

Formula

a(n) = A078350(n) - 1 for n > 1.
a(A196871(n)) = 0. - Reinhard Zumkeller, Oct 08 2011
From Robert Israel, Dec 05 2017: (Start)
If n is odd, a(n) = a(3*n+1) + A010051(n).
If n is even, a(n) = a(n/2). (End)

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Aug 09 2001

A196871 Numbers having no odd primes in their Collatz (3x+1) trajectory.

Original entry on oeis.org

1, 2, 4, 8, 16, 21, 32, 42, 64, 84, 85, 128, 168, 170, 256, 336, 340, 341, 453, 512, 672, 680, 682, 906, 909, 1024, 1344, 1360, 1364, 1365, 1812, 1813, 1818, 2048, 2688, 2720, 2728, 2730, 3624, 3626, 3636, 4096, 5376, 5440, 5456, 5460, 5461, 7248, 7252, 7272
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 08 2011

Keywords

Comments

Union of A000079 and A078440;
A055509(a(n)) = 0; A078350(a(n)) <= 1.

Crossrefs

Cf. A006370; subsequence of A065090.
Cf. A221475 (odd numbers in this sequence).

Programs

  • Haskell
    a196871 n = a196871_list !! (n-1)
    a196871_list = filter
       (all (== 0) . map a010051 . takeWhile (> 2) . iterate a006370) [1..]
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Join[{1, 2}, Select[Range[3, 10000], Union[Drop[PrimeQ[Collatz[#]], -2]] == {False} &]] (* T. D. Noe, Jan 22 2013 *)

A078373 n sets a record for the number of primes in {n, f(n), f(f(n)), ..., 1}, where f is the Collatz function defined by f(x) = x/2 if x is even; f(x) = 3x + 1 if x is odd.

Original entry on oeis.org

2, 3, 7, 19, 27, 97, 171, 231, 487, 763, 1071, 4011, 6171, 10971, 17647, 47059, 99151, 117511, 202471, 260847, 481959, 963919, 1564063, 1805311, 1993215, 6991599, 8400511, 11200681, 36791535, 46564287, 103359483, 206718967, 359502063
Offset: 1

Views

Author

Joseph L. Pe, Dec 24 2002

Keywords

Examples

			The sequence n, f(n), f(f(n)), ..., 1 for n = 7 is: 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, which has six prime terms, more prime terms than for any n < 7. Hence 7 sets a record and so belongs to the sequence.
		

Crossrefs

A362958 gives the corresponding numbers of primes.

Programs

Extensions

a(18)-a(30) from Donovan Johnson, Jul 02 2010
a(31)-a(33) from Carlos Rivera, Apr 15 2012

A177000 The Collatz iteration of these primes produces only even numbers, primes and 1.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 29, 37, 53, 59, 67, 89, 101, 131, 149, 157, 179, 181, 197, 241, 269, 277, 349, 397, 739, 853, 1109, 1237, 1429, 1621, 1861, 1877, 2161, 2389, 2531, 2957, 3413, 3797, 4549, 5717, 7621, 10069, 13397, 17749, 20021, 31541, 40277
Offset: 1

Views

Author

T. D. Noe, Apr 30 2010

Keywords

Comments

The Collatz iteration of primes of the form (10*4^k-1)/3 produces only one additional prime: 5. The Collatz iteration of primes of the form (13*4^k-1)/3 produces only two additional primes: 5 and 13. This sequence is probably infinite.
In a sense, these are the simplest Collatz iterations starting with a prime number. Except for the increases (3x+1) when an odd prime occurs, the sequence produced by starting with a(n) is decreasing. All the primes that occur in such a Collatz iteration are in this sequence. - T. D. Noe, Oct 05 2011

Examples

			The Collatz iteration of 7 produces 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, and 1, which are either even, prime, or 1.
		

Crossrefs

Programs

A181921 The smallest positive integer that produces exactly n primes in a Collatz trajectory.

Original entry on oeis.org

2, 5, 3, 15, 11, 7, 19, 43, 67, 89, 39, 127, 123, 223, 111, 351, 175, 155, 103, 63, 107, 71, 47, 31, 27, 97, 193, 171, 231, 487, 1087, 763, 2223, 2143, 1263, 1071, 4011, 6919, 8127, 13183, 6591, 6943, 6171, 10971, 46443, 48927, 35295, 17647, 70589, 47059
Offset: 1

Views

Author

G. L. Honaker, Jr., Apr 01 2012

Keywords

Examples

			a(6) = 7 because the Collatz trajectory of 7 is {7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1}, containing 6 primes {7, 11, 17, 13, 5, 2}, and 7 is the smallest positive integer for which exactly 6 primes occur via this trajectory.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a181921 = (+ 1) . fromJust . (`elemIndex` a078350_list)
    -- Reinhard Zumkeller, Apr 03 2012
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; nn = 50; t = Table[0, {nn}]; t[[1]] = 2; todo = nn - 1; n = 3; While[todo > 0, ps = Length[Select[Collatz[n], PrimeQ]]; If[ps <= nn && t[[ps]] == 0, t[[ps]] = n; todo--]; n = n + 2]; t (* T. D. Noe, Apr 02 2012 *)
    With[{lst=Table[Count[NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&],?PrimeQ],{n, 71000}]},Table[Position[lst,k,1,1],{k,50}]//Flatten] (* _Harvey P. Dale, Sep 08 2018 *)
  • PARI
    np(n)=my(t=1);while(n>2,t+=isprime(n);if(n%2,n+=n>>1+1,n>>=1));t
    v=vector(40);n=1;while(1,t=np(n++);if(t<=#v&&v[t]==0, v[t]=n; if(vecmin(v), return(v)))) \\ Charles R Greathouse IV, Apr 01 2012
    

Extensions

a(13)-a(50) from Charles R Greathouse IV, Apr 01 2012

A275866 Number of semiprimes in {n, f(n), f(f(n)), ...., 1}, where f is the Collatz function.

Original entry on oeis.org

0, 0, 2, 1, 1, 3, 5, 1, 7, 2, 4, 3, 2, 6, 6, 1, 3, 7, 6, 2, 2, 5, 4, 3, 8, 3, 38, 6, 5, 6, 36, 1, 9, 4, 4, 7, 6, 7, 12, 2, 37, 2, 9, 5, 4, 5, 35, 3, 8, 8, 8, 3, 2, 38, 38, 6, 11, 6, 10, 6, 5, 37, 36, 1, 9, 9, 8, 4, 4, 4, 34, 7, 38, 7, 3, 7, 7, 12, 11, 2, 6, 38
Offset: 1

Views

Author

Michel Lagneau, Aug 11 2016

Keywords

Comments

Number of semiprimes in the trajectory of n under the 3x+1 map (i.e. the number of semiprimes until the trajectory reaches 1).
It seems that about 15% of the terms satisfy a(i) = a(i+1). For example, up to 100000, 15140 terms satisfy this condition.

Examples

			a(9)=7 because the trajectory of 9 is 9 -> 28 -> 14 -> 7 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 and the 7 semiprimes of this trajectory are 9, 14, 22, 34, 26, 10 and 4.
		

Crossrefs

Programs

  • Mathematica
    Table[Count[NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, n, # != 1 &], k_ /; PrimeOmega@ k == 2], {n, 82}] (* Michael De Vlieger, Aug 11 2016 *)
  • PARI
    print1(0, ", ");for(n=2, 100, s=n; t=0; while(s!=1, if(bigomega(s)==2 , t=t+1, t=t); if(s%2==0, s=s/2, s=(3*s+1)); if(s==1, print1(t", "))))

A078440 Numbers n with property that n is not a power of 2 and the finite sequence n, f(n), f(f(n)), ...., 1 in the Collatz (or 3x + 1) problem contains exactly one prime. (The earliest "1" is meant.)

Original entry on oeis.org

21, 42, 84, 85, 168, 170, 336, 340, 341, 453, 672, 680, 682, 906, 909, 1344, 1360, 1364, 1365, 1812, 1813, 1818, 2688, 2720, 2728, 2730, 3624, 3626, 3636, 5376, 5440, 5456, 5460, 5461, 7248, 7252, 7272, 7281, 9669
Offset: 1

Views

Author

Joseph L. Pe, Dec 31 2002

Keywords

Comments

f(n) = n/2 if n is even, = 3n + 1 if n is odd. Powers 2^n trivially have exactly one prime in n, f(n), f(f(n)), ..., 2, 1, namely 2 and so are excluded from the sequence.
A055509(a(n)) = 0; A078350(a(n)) <= 1.

Examples

			n, f(n), f(f(n)), .... for n = 21 is: 21, 64, 32, 16, 8, 4, 2, 1, which has exactly one prime, that is, 2. Hence 21 belongs to the sequence.
		

Crossrefs

A006370; subsequence of A196871 (with binary powers).

Programs

A068684 Primes obtained as a concatenation p,q,p where p and q are successive primes and p

Original entry on oeis.org

353, 131713, 171917, 192319, 293129, 374137, 434743, 596159, 677167, 139149139, 163167163, 179181179, 223227223, 229233229, 269271269, 281283281, 347349347, 379383379, 547557547, 683691683, 761769761, 857859857, 863877863, 102110311021, 103910491039, 108710911087, 109110931091, 109310971093
Offset: 1

Views

Author

Amarnath Murthy, Mar 02 2002

Keywords

Examples

			171917 is a prime which is the concatenation of 17, 19 and 17.
		

Crossrefs

Programs

  • Maple
    cat3:= proc(a,b,c) local alpha,beta;
        beta:= ilog10(c)+1;
        alpha:= beta + ilog10(b)+1;
        10^alpha*a + 10^beta*b + c
    end proc:
    R:= NULL: count:= 0: q:= 2:
    while count < 100 do
      p:= q; q:= nextprime(q);
      v:= cat3(p,q,p);
      if isprime(v) then R:= R,v; count:= count+1;
      fi
    od:
    R; # Robert Israel, Jul 01 2025
  • PARI
    f(n)=prime(n)*(10^(ceil(log(prime(n+1))/log(10))+ceil(log(prime(n))/log(10))))+ prime(n+1)*10^ceil(log(prime(n))/log(10))+prime(n);
    for(n=1,300, if(isprime(f(n))==1, print1(f(n),", ")))

Extensions

More terms from Benoit Cloitre, Mar 21 2002
More terms from Robert Israel, Jul 02 2025

A267830 Number of nonprime numbers in {n, f(n), f(f(n)), ...., 1}, where f is the Collatz function defined by f(x) = x/2 if x is even; f(x) = 3x + 1 if x is odd.

Original entry on oeis.org

1, 1, 5, 2, 4, 6, 11, 3, 14, 5, 10, 7, 7, 12, 14, 4, 9, 15, 14, 6, 7, 11, 12, 8, 17, 8, 87, 13, 13, 15, 83, 5, 20, 10, 11, 16, 15, 15, 24, 7, 85, 8, 22, 12, 13, 13, 82, 9, 18, 18, 19, 9, 9, 88, 89, 14, 25, 14, 22, 16, 15, 84, 88, 6, 21, 21, 19, 11, 12, 12, 81
Offset: 1

Views

Author

Michel Lagneau, Jan 21 2016

Keywords

Comments

Number of nonprime numbers in the trajectory of n under the 3x+1 map (i.e., the number of nonprime numbers until the trajectory reaches 1).
It seems that about 20% of the terms satisfy a(i) = a(i+1). For example, up to 10^6, 201085 terms satisfy this condition.

Examples

			a(9)=14 because the trajectory of 9 is 9 -> 28 -> 14 -> 7 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 and the 14 nonprimes of this trajectory are 9, 28, 14, 22, 34, 52, 26, 40, 20, 10, 16, 8, 4, and 1.
		

Crossrefs

Programs

  • Mathematica
    A267830[n_] := Count[NestWhileList[If[EvenQ@#, #/2, 3 # + 1] &, n, # != 1 &], ?(Not@PrimeQ@# &)] (* _JungHwan Min, Jan 24 2016 *)
  • PARI
    for(n=1, 100, s=n; t=0; while(s!=1, if(!isprime(s) , t++); if(s%2==0, s=s/2, s=(3*s+1)); if(s==1, print1(t+1, ", "); ); ))

Formula

a(n)= A008908(n) - A078350(n).
Showing 1-10 of 13 results. Next