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

A000787 Strobogrammatic numbers: the same upside down.

Original entry on oeis.org

0, 1, 8, 11, 69, 88, 96, 101, 111, 181, 609, 619, 689, 808, 818, 888, 906, 916, 986, 1001, 1111, 1691, 1881, 1961, 6009, 6119, 6699, 6889, 6969, 8008, 8118, 8698, 8888, 8968, 9006, 9116, 9696, 9886, 9966, 10001, 10101, 10801, 11011, 11111, 11811, 16091, 16191
Offset: 1

Views

Author

Keywords

Comments

Strobogrammatic numbers are a kind of ambigrams that retain the same meaning when viewed upside down. - Daniel Mondot, Sep 27 2016
"Upside down" here means rotated by 180 degrees (i.e., central symmetry), NOT "vertically flipped" (symmetry w.r.t. horizontal line, which are in A045574). - M. F. Hasler, May 04 2012

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A007597 (Primes in this sequence), A057770, A111065, A169731 (another version).
Subsequence of A045574. - M. F. Hasler, May 04 2012

Programs

  • Mathematica
    fQ[n_] := Block[{s = {0, 1, 6, 8, 9}, id = IntegerDigits[n]}, If[ Union[ Join[s, id]] == s && (id /. {6 -> 9, 9 -> 6}) == Reverse[id], True, False]]; Select[ Range[0, 16190], fQ[ # ] &] (* Robert G. Wilson v, Oct 11 2005 *)
  • Python
    from itertools import count, islice, product
    def ud(s): return s[::-1].translate({ord('6'):ord('9'), ord('9'):ord('6')})
    def agen():
        yield from [0, 1, 8]
        for d in count(2):
            for start in "1689":
                for rest in product("01689", repeat=d//2-1):
                    left = start + "".join(rest)
                    right = ud(left)
                    for mid in [[""], ["0", "1", "8"]][d%2]:
                        yield int(left + mid + right)
    print(list(islice(agen(), 47))) # Michael S. Branicky, Mar 29 2022

Extensions

More terms from Robert G. Wilson v, Oct 11 2005

A006072 Numbers with mirror symmetry about middle.

Original entry on oeis.org

0, 1, 8, 11, 88, 101, 111, 181, 808, 818, 888, 1001, 1111, 1881, 8008, 8118, 8888, 10001, 10101, 10801, 11011, 11111, 11811, 18081, 18181, 18881, 80008, 80108, 80808, 81018, 81118, 81818, 88088, 88188, 88888, 100001, 101101, 108801, 110011, 111111, 118811, 180081
Offset: 1

Views

Author

Keywords

Comments

Apparently this sequence and A111065 have the same parity. - Jeremy Gardiner, Oct 15 2005
Obviously, terms of this sequence also have the same parity (and also the same digital sum mod 6) as those of A118594, see below. - M. F. Hasler, May 08 2013
The number of n-digit terms is given by A225367 -- which counts palindromes in base 3, A118594. The terms here are the base 3 palindromes considered there, with 2 replaced by 8 (which means this sequence A006072 arises from A118594 not only by taking the 3rd power of each digit, but also by superposing the number with its horizontal or vertical reflection, somehow remarkably given the symmetry of numbers considered here). - M. F. Hasler, May 05 2013 [Part of the comment moved from A225367 to here on May 08 2013]

References

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

Crossrefs

Subsequence of A000787. Cf. A045574.

Programs

  • Mathematica
    NextPalindrome[n_] := Block[{l = Floor[Log[10, n] + 1], idn = IntegerDigits[n]}, If[ Union[idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[idn, Ceiling[l/2]]]] > FromDigits[ Take[idn, -Ceiling[l/2]]], FromDigits[ Join[ Take[idn, Ceiling[l/2]], Reverse[ Take[idn, Floor[l/2]]]]], idfhn = FromDigits[ Take[idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[ idfhn], Drop[ Reverse[ IntegerDigits[ idfhn]], Mod[l, 2]]]]]]]]; np = 0; t = {0}; Do[np = NextPalindrome[np]; If[Union[Join[{0, 1, 8}, IntegerDigits[np]]] == {0, 1, 8}, AppendTo[t, np]], {n, 1150}]; t (* Robert G. Wilson v *)
    TetrNumsUpTo10powerK[k_]:= Select[FromDigits/@ Tuples[{0, 1, 8}, k],IntegerDigits[#] == Reverse[IntegerDigits[#]] &]; TetrNumsUpTo10powerK[7] (* Mikk Heidemaa, May 21 2017 *)
  • PARI
    {for(l=1,5,u=vector((l+1)\2,i,10^(i-1)+(2*i-11&&i==1,2]), print1((v+v\2*6)*u", ")))} \\ The n-th term could be produced by using (partial sums of) A225367 to skip all shorter terms, and then skipping the adequate number of vectors v until n is reached. - M. F. Hasler, May 05 2013
    
  • Python
    from itertools import count, islice, product
    def agen():
        yield from [0, 1, 8]
        for d in count(2):
            for start in "18":
                for rest in product("018", repeat=d//2-1):
                    left = start + "".join(rest)
                    for mid in [[""], ["0", "1", "8"]][d%2]:
                        yield int(left + mid + left[::-1])
    print(list(islice(agen(), 42))) # Michael S. Branicky, Mar 29 2022

Formula

a(n) = digit-wise application of A000578 to A118594(n). - M. F. Hasler, May 08 2013

Extensions

More terms from Robert G. Wilson v, Nov 16 2005

A111575 Powers of 3 repeated four times.

Original entry on oeis.org

1, 1, 1, 1, 3, 3, 3, 3, 9, 9, 9, 9, 27, 27, 27, 27, 81, 81, 81, 81, 243, 243, 243, 243, 729, 729, 729, 729, 2187, 2187, 2187, 2187, 6561, 6561, 6561, 6561, 19683, 19683, 19683, 19683, 59049, 59049, 59049, 59049, 177147, 177147, 177147, 177147, 531441
Offset: 0

Views

Author

Jeremy Gardiner, Nov 17 2005

Keywords

Comments

Generating sequence for the number of 0's and 1's (run lengths) in the parity of A006072, A111065 and A118594.

Examples

			a(10) = 3^floor(10/4) = 3^2 = 9.
		

Crossrefs

Programs

Formula

a(n) = 3^floor(n/4).
O.g.f.: -(1+x)*(1+x^2)/(-1+3*x^4). - R. J. Mathar, Jan 08 2008

A111156 Numbers that look the same when printed upside down.

Original entry on oeis.org

0, 8, 69, 88, 96, 609, 689, 808, 888, 906, 986, 6009, 6699, 6889, 6969, 8008, 8698, 8888, 8968, 9006, 9696, 9886, 9966, 60009, 60809, 66099, 66899, 68089, 68889, 69069, 69869, 80008, 80808, 86098, 86898, 88088, 88888, 89068, 89868, 90006, 90806, 96096, 96896, 98086, 98886, 99066, 99866, 600009
Offset: 1

Views

Author

Paul Stoeber (pstoeber(AT)uni-potsdam.de), Oct 09 2005

Keywords

Comments

Numbers with 1's are excluded.
Numbers written with digits 0,6,8,9, with 6 and 9 interchanged when reversed. - Robert Israel, Jul 02 2018

Crossrefs

Cf. strobogrammatic numbers A000787. If 8's are excluded we get A111065.

Programs

  • Haskell
    main=print$"0":concat[concat[[reverse(reverse(map f x)++z++x)|x<-y]|z<-["","0"]]|y<-s(iterate i"6")];f '0'='0';f '6'='9';f '8'='8';f '9'='6';i('0':x)='6':x;i('6':x)='8':x;i('8':x)='9':x;i('9':x)='0':i x;i""="6";s(x:y@(z:_))=let w:v=s y in if length x==length z then(x:w):v else[x]:w:v
    
  • Maple
    f:= proc(n) local L,Lp,nl;
       L:= subs(1=6,2=8,3=9,convert(n,base,4));
       nl:= nops(L);
       Lp:= subs([6=9,9=6],L);
       add(Lp[-i]*10^(i-1),i=1..nl)+add(L[i]*10^(nl+i-1),i=1..nl);
    end proc:
    g:= proc(n) local L,Lp,nl;
       L:= subs(1=6,2=8,3=9,convert(n,base,4));
       nl:= nops(L);
       Lp:= subs([6=9,9=6],L);
       seq(add(Lp[-i]*10^(i-1),i=1..nl)+x*10^nl+add(L[i]*10^(nl+i),i=1..nl),x=[0,8]);
    end proc:
    0,8,seq(op([seq(f(n),n=4^i..4^(i+1)-1),seq(g(n),n=4^i..4^(i+1)-1)]),i=0..2); # Robert Israel, Jul 02 2018
  • Mathematica
    Select[Range[0,600010],ContainsOnly[IntegerDigits[#],{0,6,8,9}]&&IntegerReverse[FromDigits[IntegerDigits[#]/.{6->9,9->6}]]==#&] (* James C. McMahon, Apr 30 2024 *)
  • Python
    from itertools import count, islice, product
    def ud(s): return s[::-1].translate({ord('6'):ord('9'), ord('9'):ord('6')})
    def agen():
        yield from [0, 8]
        for d in count(2):
            for start in "689":
                for rest in product("0689", repeat=d//2-1):
                    left = start + "".join(rest)
                    right = ud(left)
                    for mid in [[""], ["0", "8"]][d%2]:
                        yield int(left + mid + right)
    print(list(islice(agen(), 48))) # Michael S. Branicky, Mar 29 2022

Extensions

Corrected by Robert Israel, Jul 02 2018

A246880 6*((10^n-1)/9)*(10^(n+1))+9*(10^n-1)/9.

Original entry on oeis.org

0, 609, 66099, 6660999, 666609999, 66666099999, 6666660999999, 666666609999999, 66666666099999999, 6666666660999999999, 666666666609999999999, 66666666666099999999999, 6666666666660999999999999, 666666666666609999999999999, 66666666666666099999999999999
Offset: 0

Views

Author

Felix Fröhlich, Sep 06 2014

Keywords

Comments

Numbers of the form 6...609...9 (i.e., consisting of an odd number of digits with the middle digit 0, all digits to the left of the middle digit 6 and all digits to the right of the middle digit 9).

Crossrefs

Programs

  • Magma
    [(6*((10^n - 1)/9))*(10^(n + 1)) + (9*(10^n - 1)/9) : n in [0..15]]; // Wesley Ivan Hurt, Sep 15 2014
  • Maple
    A246880:=n->(6*((10^n - 1)/9))*(10^(n + 1)) + (9*(10^n - 1)/9): seq(A246880(n),n=0..15); # Wesley Ivan Hurt, Sep 15 2014
  • Mathematica
    Table[(6*((10^n - 1)/9))*(10^(n + 1)) + (9*(10^n - 1)/9), {n, 15}] (* Wesley Ivan Hurt, Sep 15 2014 *)
    Join[{0}, CoefficientList[Series[20/(3 x - 300 x^2) + 1/(x^2 - x) + 17/(30 x^2 - 3 x), {x, 0, 30}], x]] (* Wesley Ivan Hurt, Sep 15 2014 *)
  • PARI
    a(n)=6*((10^n-1)/9)*(10^(n+1))+9*(10^n-1)/9
    

Formula

G.f.: 20/(3-300*x)+1/(x-1)+17/(30*x-3); a(n) = 111*a(n-1)-1110*a(n-2)+1000*a(n-3). - Wesley Ivan Hurt, Sep 15 2014
Showing 1-5 of 5 results.