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

A048986 Home primes in base 2: primes reached when you start with n and (working in base 2) concatenate its prime factors (A048985); repeat until a prime is reached (or -1 if no prime is ever reached). Answer is written in base 10.

Original entry on oeis.org

1, 2, 3, 31, 5, 11, 7, 179, 29, 31, 11, 43, 13, 23, 29, 12007, 17, 47, 19, 251, 31, 43, 23, 499, 4091, 4091, 127, 4091, 29, 127, 31, 1564237, 59, 4079, 47, 367, 37, 83, 61, 383, 41, 179, 43, 499, 4091, 4091, 47, 683, 127, 173, 113, 173, 53, 191, 4091
Offset: 1

Views

Author

Michael B Greenwald (mbgreen(AT)central.cis.upenn.edu)

Keywords

Comments

a(1) = 1 by convention.
The first binary home prime that is not known is a(2295). - Ely Golden, Jan 09 2017

Examples

			4 = 2*2 -> 1010 = 10 = 2*5 ->10101 = 21 = 3*7 -> 11111 = 31 = prime.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Module[{fi}, If[PrimeQ[n], n, fi = FactorInteger[n]; Table[ First[#], {Last[#]}]& /@ fi // Flatten // IntegerDigits[#, 2]& // Flatten // FromDigits[#, 2]&]]; a[1] = 1; a[n_] := TimeConstrained[FixedPoint[f, n], 1] /. $Aborted -> -1; Array[a, 55] (* Jean-François Alcover, Jan 01 2016 *)
  • Python
    from sympy import factorint, isprime
    def f(n):
        if n == 1: return 1
        return int("".join(bin(p)[2:]*e for p, e in factorint(n).items()), 2)
    def a(n):
        if n == 1: return 1
        while not isprime(n): n = f(n)
        return n
    print([a(n) for n in range(1, 56)]) # Michael S. Branicky, Oct 07 2022
  • SageMath
    def digitLen(x,n):
        r=0
        while(x>0):
            x//=n
            r+=1
        return r
    def concatPf(x,n):
        r=0
        f=list(factor(x))
        for c in range(len(f)):
            for d in range(f[c][1]):
                r*=(n**digitLen(f[c][0],n))
                r+=f[c][0]
        return r
    def hp(x,n):
        x1=concatPf(x,n)
        while(x1!=x):
            x=x1
            x1=concatPf(x1,n)
        return x
    radix=2
    index=2
    while(index<=1344):
        print(str(index)+" "+str(hp(index,radix)))
        index+=1
    

A112417 Sequence is generated as in A048985, but primes are instead written in decreasing order before being concatenated.

Original entry on oeis.org

1, 2, 3, 10, 5, 14, 7, 42, 15, 22, 11, 58, 13, 30, 23, 170, 17, 62, 19, 90, 31, 46, 23, 234, 45, 54, 63, 122, 29, 94, 31, 682, 47, 70, 61, 250, 37, 78, 55, 362, 41, 126, 43, 186, 95, 94, 47, 938, 63, 182, 71, 218, 53, 254, 93, 490, 79, 118, 59, 378, 61, 126, 127, 2730
Offset: 1

Views

Author

Leroy Quet, Dec 09 2005

Keywords

Examples

			12 = 3 * 2^2, with prime divisors written in descending order.
So we have 3 = 11 binary, 2 = 10 binary, 2 = 10 binary, which is (after concatenation) 111010. So a(12) is 111010 = 58 when converted from binary to decimal.
		

Crossrefs

Extensions

More terms from Diana L. Mecum, Jul 14 2007

A064795 Home primes in base 2: primes reached when you start with n and (working in base 2) concatenate its prime factors (A048985); repeat until a prime is reached (or -1 if no prime is ever reached).

Original entry on oeis.org

1, 10, 11, 11111, 101, 1011, 111, 10110011, 11101, 11111, 1011, 101011, 1101, 10111, 11101, 10111011100111, 10001, 101111, 10011, 11111011, 11111, 101011, 10111, 111110011, 111111111011, 111111111011, 1111111, 111111111011, 11101
Offset: 1

Views

Author

N. J. A. Sloane, Oct 31 2001

Keywords

Comments

a(1) = 1 by convention.

Crossrefs

See A048986 for base 10 representation. Cf. A037274.

Extensions

More terms from David Wasserman, Aug 15 2002

A029744 Numbers of the form 2^n or 3*2^n.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576, 32768, 49152, 65536, 98304, 131072, 196608, 262144, 393216, 524288, 786432, 1048576, 1572864, 2097152, 3145728, 4194304
Offset: 1

Views

Author

Keywords

Comments

This entry is a list, and so has offset 1. WARNING: However, in this entry several comments, formulas and programs seem to refer to the original version of this sequence which had offset 0. - M. F. Hasler, Oct 06 2014
Number of necklaces with n-1 beads and two colors that are the same when turned over and hence have reflection symmetry. [edited by Herbert Kociemba, Nov 24 2016]
The subset {a(1),...,a(2k)} contains all proper divisors of 3*2^k. - Ralf Stephan, Jun 02 2003
Let k = any nonnegative integer and j = 0 or 1. Then n+1 = 2k + 3j and a(n) = 2^k*3^j. - Andras Erszegi (erszegi.andras(AT)chello.hu), Jul 30 2005
Smallest number having no fewer prime factors than any predecessor, a(0)=1; A110654(n) = A001222(a(n)); complement of A116451. - Reinhard Zumkeller, Feb 16 2006
A093873(a(n)) = 1. - Reinhard Zumkeller, Oct 13 2006
a(n) = a(n-1) + a(n-2) - gcd(a(n-1), a(n-2)), n >= 3, a(1)=2, a(2)=3. - Ctibor O. Zizka, Jun 06 2009
Where records occur in A048985: A193652(n) = A048985(a(n)) and A193652(n) < A048985(m) for m < a(n). - Reinhard Zumkeller, Aug 08 2011
A002348(a(n)) = A000079(n-3) for n > 2. - Reinhard Zumkeller, Mar 18 2012
Without initial 1, third row in array A228405. - Richard R. Forberg, Sep 06 2013
Also positions of records in A048673. A246360 gives the record values. - Antti Karttunen, Sep 23 2014
Known in numerical mathematics as "Bulirsch sequence", used in various extrapolation methods for step size control. - Peter Luschny, Oct 30 2019
For n > 1, squares of the terms can be expressed as the sum of two powers of two: 2^x + 2^y. - Karl-Heinz Hofmann, Sep 08 2022

Crossrefs

Cf. A056493, A038754, A063759. Union of A000079 and A007283.
First differences are in A016116(n-1).
Row sums of the triangle in sequence A119963. - John P. McSorley, Aug 31 2010
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A029744 = {s(n), n>=1}, the numbers 2^k and 3*2^k, as the parent. There may be minor differences from (s(n)) at the start, and a shift of indices. A029744 (s(n)); A052955 (s(n)-1), A027383 (s(n)-2), A354788 (s(n)-3), A060482 (s(n)-3); A136252 (s(n)-3); A347789 (s(n)-4), A209721 (s(n)+1), A209722 (s(n)+2), A343177 (s(n)+3), A209723 (s(n)+4); A354785 (3*s(n)), A061776 (3*s(n)-6); A354789 (3*s(n)-7). The first differences of A029744 are 1,1,1,2,2,4,4,8,8,... which essentially matches eight sequences: A016116, A060546, A117575, A131572, A152166, A158780, A163403, A320770. The bisections of A029744 are A000079 and A007283. - N. J. A. Sloane, Jul 14 2022

Programs

  • Haskell
    a029744 n = a029744_list !! (n-1)
    a029744_list = 1 : iterate
       (\x -> if x `mod` 3 == 0 then 4 * x `div` 3 else 3 * x `div` 2) 2
    -- Reinhard Zumkeller, Mar 18 2012
    
  • Maple
    1,seq(op([2^i,3*2^(i-1)]),i=1..100); # Robert Israel, Sep 23 2014
  • Mathematica
    CoefficientList[Series[(-x^2 - 2*x - 1)/(2*x^2 - 1), {x, 0, 200}], x] (* Vladimir Joseph Stephan Orlovsky, Jun 10 2011 *)
    Function[w, DeleteCases[Union@ Flatten@ w, k_ /; k > Max@ First@ w]]@ TensorProduct[{1, 3}, 2^Range[0, 22]] (* Michael De Vlieger, Nov 24 2016 *)
    LinearRecurrence[{0,2},{1,2,3},50] (* Harvey P. Dale, Jul 04 2017 *)
  • PARI
    a(n)=if(n%2,3/2,2)<<((n-1)\2)\1
    
  • Python
    def A029744(n):
        if n == 1: return 1
        elif n % 2 == 0: return 2**(n//2)
        else: return 3 * 2**((n-3)//2) # Karl-Heinz Hofmann, Sep 08 2022
  • Scheme
    (define (A029744 n) (cond ((<= n 1) n) ((even? n) (expt 2 (/ n 2))) (else (* 3 (expt 2 (/ (- n 3) 2)))))) ;; Antti Karttunen, Sep 23 2014
    

Formula

a(n) = 2*A000029(n) - A000031(n).
For n > 2, a(n) = 2*a(n - 2); for n > 3, a(n) = a(n - 1)*a(n - 2)/a(n - 3). G.f.: (1 + x)^2/(1 - 2*x^2). - Henry Bottomley, Jul 15 2001, corrected May 04 2007
a(0)=1, a(1)=1 and a(n) = a(n-2) * ( floor(a(n-1)/a(n-2)) + 1 ). - Benoit Cloitre, Aug 13 2002
(3/4 + sqrt(1/2))*sqrt(2)^n + (3/4 - sqrt(1/2))*(-sqrt(2))^n. a(0)=1, a(2n) = a(n-1)*a(n), a(2n+1) = a(n) + 2^floor((n-1)/2). - Ralf Stephan, Apr 16 2003 [Seems to refer to the original version with offset=0. - M. F. Hasler, Oct 06 2014]
Binomial transform is A048739. - Paul Barry, Apr 23 2004
E.g.f.: (cosh(x/sqrt(2)) + sqrt(2)sinh(x/sqrt(2)))^2.
a(1) = 1; a(n+1) = a(n) + A000010(a(n)). - Stefan Steinerberger, Dec 20 2007
u(2)=1, v(2)=1, u(n)=2*v(n-1), v(n)=u(n-1), a(n)=u(n)+v(n). - Jaume Oliver Lafont, May 21 2008
For n => 3, a(n) = sqrt(2*a(n-1)^2 + (-2)^(n-3)). - Richard R. Forberg, Aug 20 2013
a(n) = A064216(A246360(n)). - Antti Karttunen, Sep 23 2014
a(n) = sqrt((17 - (-1)^n)*2^(n-4)) for n >= 2. - Anton Zakharov, Jul 24 2016
Sum_{n>=1} 1/a(n) = 8/3. - Amiram Eldar, Nov 12 2020
a(n) = 2^(n/2) if n is even. a(n) = 3 * 2^((n-3)/2) if n is odd and for n>1. - Karl-Heinz Hofmann, Sep 08 2022

Extensions

Corrected and extended by Joe Keane (jgk(AT)jgk.org), Feb 20 2000

A037276 Start with 1; for n>1, replace n with the concatenation of its prime factors in increasing order.

Original entry on oeis.org

1, 2, 3, 22, 5, 23, 7, 222, 33, 25, 11, 223, 13, 27, 35, 2222, 17, 233, 19, 225, 37, 211, 23, 2223, 55, 213, 333, 227, 29, 235, 31, 22222, 311, 217, 57, 2233, 37, 219, 313, 2225, 41, 237, 43, 2211, 335, 223, 47, 22223, 77, 255, 317, 2213, 53, 2333
Offset: 1

Views

Author

Keywords

Examples

			If n = 2^3*5^5*11^2 = 3025000, a(n) = 222555551111 (n=2*2*2*5*5*5*5*5*11*11, then remove the multiplication signs).
		

Crossrefs

Cf. A037274, A048985, A067599, A080670, A084796. Different from A073646.
Cf. also A027746, A289660 (a(n)-n).

Programs

  • Haskell
    a037276 = read . concatMap show . a027746_row
    -- Reinhard Zumkeller, Apr 03 2012
    
  • Maple
    # This is for n>1
    read("transforms") ;
    A037276 := proc(n)
        local L,p ;
        L := [] ;
        for p in ifactors(n)[2] do
            L := [op(L),seq(op(1,p),i=1..op(2,p))] ;
        end do:
        digcatL(L) ;
    end proc: # R. J. Mathar, Oct 29 2012
  • Mathematica
    co[n_, k_] := Nest[Flatten[IntegerDigits[{#, n}]] &, n, k - 1]; Table[FromDigits[Flatten[IntegerDigits[co @@@ FactorInteger[n]]]], {n, 54}] (* Jayanta Basu, Jul 04 2013 *)
    FromDigits@ Flatten@ IntegerDigits[Table[#1, {#2}] & @@@ FactorInteger@ #] & /@ Range@ 54 (* Michael De Vlieger, Jul 14 2015 *)
  • PARI
    a(n)={ n<4 & return(n); for(i=1,#n=factor(n)~, n[1,i]=concat(vector(n[2,i],j,Str(n[1,i])))); eval(concat(n[1,]))}  \\ M. F. Hasler, Jun 19 2011
    
  • Python
    from sympy import factorint
    def a(n):
        f=factorint(n)
        l=sorted(f)
        return 1 if n==1 else int("".join(str(i)*f[i] for i in l))
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 23 2017

A193652 A020988 and A007583 interleaved.

Original entry on oeis.org

0, 1, 2, 3, 10, 11, 42, 43, 170, 171, 682, 683, 2730, 2731, 10922, 10923, 43690, 43691, 174762, 174763, 699050, 699051, 2796202, 2796203, 11184810, 11184811, 44739242, 44739243, 178956970, 178956971, 715827882, 715827883, 2863311530, 2863311531, 11453246122
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 08 2011

Keywords

Comments

a(2*n) = A020988(n), a(2*n+1) = a(2*n) + 1 = A007583(n);
apart from initial zero, record values in A048985: a(n)=A048985(A029744(n)) and a(n)<A048985(m) for m<A029744(n).

Programs

Formula

a(n) = 2 * (4^floor(n/2) - 1) / 3 + n mod 2.
G.f.: ( -x*(-1-2*x+2*x^2) ) / ( (x-1)*(2*x+1)*(2*x-1)*(1+x) ). - R. J. Mathar, Feb 19 2015

Extensions

Terms corrected by R. J. Mathar, Feb 19 2015

A006919 Write down all the prime divisors in previous term.

Original entry on oeis.org

8, 222, 2337, 31941, 33371313, 311123771, 7149317941, 22931219729, 112084656339, 3347911118189, 11613496501723, 97130517917327, 531832651281459, 3331113965338635107, 3331113965338635107
Offset: 1

Views

Author

Keywords

References

  • H. Jaleebi, personal communication.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A056938 (same for a(1)=49), A037271-A037276, A048985, A048986, A049065.

Programs

  • Mathematica
    g[ n_ ] := (x = n; d = {}; While[ FactorInteger[ x ] != {}, f = FactorInteger[ x, FactorComplete -> True ][ [ 1, 1 ] ]; x = x/f; AppendTo[ d, IntegerDigits[ f ] ] ]; FromDigits[ Flatten[ d ] ]); NestList[ g, 8, 15 ]
    NestList[FromDigits[Flatten[IntegerDigits/@(Table[First[#],{Last[#]}]& /@ FactorInteger[#])]]&,8,15] (* Harvey P. Dale, Dec 04 2011 *)
  • PARI
    first(N, a=8)=vector(N,i,if(i>1,a=A037276(a),a)) \\ M. F. Hasler, Oct 07 2022

Formula

a(n+1) = A037276(a(n)), a(1) = 8. - M. F. Hasler, Oct 07 2022

Extensions

More terms from Robert G. Wilson v, Sep 05 2000, who remarks that sequence stabilizes at 13th term with a prime.

A049065 Record primes reached in A048986.

Original entry on oeis.org

2, 3, 31, 179, 12007, 1564237, 17320726789571, 401278664296369, 576312045441408907, 37246812772043701411753149215934377, 3690727229000499480592573891534356177653018575120050845976045596834749951228879
Offset: 1

Views

Author

Michael B Greenwald (mbgreen(AT)central.cis.upenn.edu)

Keywords

Comments

The value 37246812772043701411753149215934377 is the base-2 home prime for 922 and occurs after 66 steps. The value 3690727229000499480592573891534356177653018575120050845976045596834749951228879 is the base-2 home prime for 1345 and occurs after 131 steps. The next term (home prime for 2295) contains at least 124 digits. Computation of further terms involves large factorizations. - Sean A. Irvine, Aug 04 2005 [corrected Jul 17 2021]

Crossrefs

Extensions

a(10)-a(11) from Sean A. Irvine, Aug 04 2005
a(10) corrected by Sean A. Irvine, Jul 17 2021

A064841 Working in base 2, replace n with the concatenation of its prime divisors in increasing order.

Original entry on oeis.org

1, 10, 11, 1010, 101, 1011, 111, 101010, 1111, 10101, 1011, 101011, 1101, 10111, 11101, 10101010, 10001, 101111, 10011, 1010101, 11111, 101011, 10111, 10101011, 101101, 101101, 111111, 1010111, 11101, 1011101, 11111, 1010101010, 111011
Offset: 1

Views

Author

N. J. A. Sloane, Oct 31 2001

Keywords

Examples

			15 = 3*5 -> 11*101 -> 11101, so a(15) = 11101.
		

Crossrefs

See A048985 for same terms written in base 10.

Extensions

More terms from Larry Reeves (larryr(AT)acm.org) and Robert G. Wilson v, Nov 01 2001
Showing 1-9 of 9 results.