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

A057770 The primes in A045574.

Original entry on oeis.org

11, 19, 61, 89, 101, 109, 181, 191, 199, 601, 619, 661, 691, 809, 811, 881, 911, 919, 991, 1009, 1019, 1061, 1069, 1091, 1109, 1181, 1601, 1609, 1619, 1669, 1699, 1801, 1811, 1861, 1889, 1901, 1999, 6011, 6089, 6091, 6101, 6199, 6619, 6661, 6689, 6691
Offset: 1

Views

Author

G. L. Honaker, Jr., Nov 01 2000

Keywords

Crossrefs

Programs

  • Mathematica
    Select[FromDigits/@Tuples[{0,1,6,8 , 9},4],PrimeQ] (* Harvey P. Dale, Oct 24 2015 *)

Formula

Primes containing the digits 0, 1, 6, 8 or 9 only.

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

A054047 Numbers which can be read as (possibly different) numbers when rotated by 180 degrees (final zeros allowed).

Original entry on oeis.org

0, 1, 6, 8, 9, 10, 11, 16, 18, 19, 60, 61, 66, 68, 69, 80, 81, 86, 88, 89, 90, 91, 96, 98, 99, 100, 101, 106, 108, 109, 110, 111, 116, 118, 119, 160, 161, 166, 168, 169, 180, 181, 186, 188, 189, 190, 191, 196, 198, 199, 600, 601, 606, 608, 609, 610, 611, 616, 618
Offset: 0

Views

Author

Alain Zalmanski (alain.zalmanski(AT)cybercable.fr), Apr 28 2000

Keywords

References

  • A. Zalmanski, Some fun with figures and letters, unpublished.

Crossrefs

Extensions

Corrected and extended by James Sellers, Apr 30 2000

A119738 Semiprimes that are semiprimes turned upside-down.

Original entry on oeis.org

6, 9, 69, 106, 111, 119, 611, 669, 689, 698, 699, 818, 866, 869, 901, 998, 1011, 1101, 1111, 1198, 1199, 1661, 1681, 1689, 1691, 1819, 1891, 1919, 1961, 1966, 1991, 6009, 6019, 6109, 6119, 6161, 6181, 6189, 6611, 6686, 6819, 6866, 6889, 6891, 8186, 8611
Offset: 1

Views

Author

Jonathan Vos Post, Jun 15 2006

Keywords

Examples

			19606 = 2 * 9803 upside-down is 90961 = 13 * 6997.
		

Crossrefs

Programs

  • Maple
    UpsideDown := proc(n) local dgs,a,i ; dgs := convert(n,base,10) ; a := [] ; for i from 1 to nops(dgs) do if op(i,dgs) = 6 then a := [9,op(a)] ; elif op(i,dgs) = 9 then a := [6,op(a)] ; else a := [op(i,dgs),op(a)] ; fi; od: add(op(i,a)*10^(i-1),i=1..nops(a)) ; end: isA054047 := proc(n) local dgs,i ; dgs := convert(n,base,10) ; for i from 1 to nops(dgs) do if not op(i,dgs) in {0,1,6,8,9} then RETURN(false) : fi; od: RETURN(true) ; end: isA001358 := proc(n) if numtheory[bigomega](n) = 2 then true; else false; fi; end: isA119738 := proc(n) if isA001358(n) and isA054047(n) then isA001358(UpsideDown(n)) ; else false ; fi; end: for n from 1 to 12000 do if isA119738(n) then printf("%a,",n) ; fi; od: # R. J. Mathar, Sep 09 2008
  • Mathematica
    Select[Range[8611],ContainsOnly[IntegerDigits[#],{0,1,6,8,9}]&&PrimeOmega[#]==2&&PrimeOmega[FromDigits[Reverse[IntegerDigits[#]]/.{6->9,9->6}]]==2&] (* James C. McMahon, Sep 18 2024 *)
  • PARI
    \\ See Corneth link. David A. Corneth, Sep 05 2020

Extensions

8186 inserted by R. J. Mathar, Sep 09 2008

A272264 Numbers that become a different number when flipped upside down.

Original entry on oeis.org

6, 9, 16, 18, 19, 61, 66, 68, 81, 86, 89, 91, 98, 99, 106, 108, 109, 116, 118, 119, 161, 166, 168, 169, 186, 188, 189, 191, 196, 198, 199, 601, 606, 608, 611, 616, 618, 661, 666, 668, 669, 681, 686, 688, 691, 696, 698, 699, 801, 806, 809, 811, 816, 819, 861, 866, 868, 869, 881, 886, 889
Offset: 1

Views

Author

A. D. Skovgaard, Apr 24 2016

Keywords

Comments

Although 2 and 5 flipped upside down on a digital clock are numbers, they are not permitted here. - David A. Corneth, May 22 2016

Crossrefs

Programs

  • PARI
    is(n) = {my(d=digits(n),dr); if(d[#d]==0 || #setminus(Set(d),Set([0,1,6,8,9])) !=0, return(0), dr=vector(#d)); for(i=1,#d, dr[#d-i+1] = if(d[i]==6||d[i]==9,15-d[i],d[i]));dr!=d} \\ David A. Corneth, May 22 2016

A317179 Palindromic invertible primes.

Original entry on oeis.org

16661, 19991, 1160611, 1190911, 1688861, 1988891, 101616101, 101919101, 106111601, 106191601, 109111901, 109161901, 116010611, 116696611, 119010911, 119969911, 160080061, 160101061, 166080661, 169060961, 188868881, 188898881, 190080091, 190101091, 196090691, 199080991
Offset: 1

Views

Author

K. D. Bajpai, Jul 23 2018

Keywords

Comments

a(38) = 10886968801 is the first term that uses all of the invertible digits (0, 1, 6, 8, 9).
Number of terms < 10^(2k-1): 0, 0, 2, 6, 26, 78, 314, 1010, 3976, 15174, ..., . - Robert G. Wilson v, Jul 24 2018
Intersection of A002385 and A048890, or, respectively, A002113 and A048890. - Felix Fröhlich, Jul 24 2018

Examples

			16661 is a term because it is a prime and a palindrome as well; when rotated by 180 degrees it becomes 19991 that is also a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[ lst = {}; fQ[n_] :=  Block[{allset = {0, 1, 6, 8, 9}, id = IntegerDigits@n},  rid = Reverse[id /. {6 -> 9, 9 -> 6}];Union@Join[id, allset] == allset && PrimeQ@FromDigits@rid &&  rid != id]; Do[If[PrimeQ@n && fQ@n,  AppendTo[lst, n]], {n, 1090000000}]; lst, # ==FromDigits[Reverse[IntegerDigits[#]]]  &]
  • PARI
    is_palandinv(n) = my(d=digits(n), ineligible_d=[2, 3, 4, 5, 7]); d==Vecrev(d) && #setintersect(vecsort(d), ineligible_d)==0
    invert(n) = my(d=digits(n), e=[]); for(k=1, #d, if(d[k]==0, e=concat(e, [0])); if(d[k]==1, e=concat(e, [1])); if(d[k]==6, e=concat(e, [9])); if(d[k]==8, e=concat(e, [8])); if(d[k]==9, e=concat(e, [6]))); subst(Pol(e), x, 10)
    is(n) = my(d=digits(n)); is_palandinv(n) && n!=invert(n) && ispseudoprime(invert(n))
    forprime(p=1, 2e8, if(is(p), print1(p, ", "))) \\ Felix Fröhlich, Jul 24 2018

A339996 Numbers whose square is rotationally ambigrammatic with no trailing zeros.

Original entry on oeis.org

0, 1, 3, 4, 9, 13, 14, 31, 33, 41, 83, 99, 103, 104, 109, 141, 247, 263, 264, 283, 301, 303, 333, 401, 436, 437, 446, 447, 781, 813, 836, 901, 947, 949, 954, 959, 999, 1003, 1004, 1009, 1053, 1054, 1291, 1349, 1367, 2467, 2486, 2609, 2849, 2949, 2986, 3001
Offset: 1

Views

Author

Philip Mizzi, Dec 25 2020

Keywords

Comments

A rotationally ambigrammatic number (A045574) is one that can be rotated by 180 degrees resulting in a readable, most often new number. Such numbers, by definition, can only contain the digits 0, 1, 6, 8, 9.
If the number once rotated happens to be the same number it is a strobogrammatic number (A000787); such numbers form a subset of the ambigrammatic numbers.
Numbers (such as 10) whose square has trailing zeros have been excluded because the rotation of such a number by 180 degrees would result in a number with leading zeros. Typically this is not the way we write numbers.
The numbers 14 and 31 are interesting numbers in this sequence in that when their square is rotated 180 degrees, the square root results in the other number. I believe this is unique to only these two numbers.

Examples

			13^2 = 169. A rotationally ambigrammatic number. Hence, 13 is a term.
15^2 = 225. Not rotationally ambigrammatic and hence 15 is not a term.
10^2 = 100. This number has trailing zeros, so under this definition of rotationally ambigrammatic, 10 is not a term.
		

Crossrefs

Cf. A045574, A340164 (squares).

Programs

  • Mathematica
    Select[Range[0, 4001], (# == 0 || !Divisible[#, 10]) && AllTrue[IntegerDigits[#^2], MemberQ[{0, 1, 6, 8, 9}, #1] &] &] (* Amiram Eldar, Dec 26 2020 *)
  • PARI
    isra(n) = (n%10) && (!setminus(Set(Vec(Str(n))), Vec("01689"))) || !n; \\ A045574
    isok(n) = isra(n^2); \\ Michel Marcus, Dec 27 2020

Formula

a(n) = sqrt(A340164(n)).

A340164 Rotationally ambigrammatic square numbers with no trailing zeros.

Original entry on oeis.org

0, 1, 9, 16, 81, 169, 196, 961, 1089, 1681, 6889, 9801, 10609, 10816, 11881, 19881, 61009, 69169, 69696, 80089, 90601, 91809, 110889, 160801, 190096, 190969, 198916, 199809, 609961, 660969, 698896, 811801, 896809, 900601, 910116, 919681, 998001, 1006009
Offset: 1

Views

Author

Philip Mizzi, Dec 30 2020

Keywords

Comments

A rotationally ambigrammatic number (A045574) is one that can be rotated by 180 degrees resulting in a readable, most often new number. Such numbers, by definition, can only contain the digits 0, 1, 6, 8, 9.
If the number once rotated happens to be the same number (e.g., 6889) it is a strobogrammatic number. Those present here are the terms of A018848.
Numbers such as 100, which is a square with trailing zeros, have been excluded. Such numbers rotated by 180 degrees would be written with leading zeros. Typically this is not the way we write numbers.
This sequence is infinite as it contains (10^k + 3)^2 and (3*10^k + 1)^2 for any k >= 0 (note also that A004086((10^k + 3)^2) = (3*10^k + 1)^2 when k > 0). - Rémy Sigrist, Dec 30 2020

Crossrefs

Intersection of A045574 and A000290.
Cf. A004086, A339996 (square roots).

Programs

  • Mathematica
    Select[Range[0, 1000], (# == 0 || ! Divisible[#, 10]) && AllTrue[IntegerDigits[#^2], MemberQ[{0, 1, 6, 8, 9}, #1] &] &]^2 (* Amiram Eldar, Dec 30 2020 *)
  • PARI
    isra(n) = (n%10) && (!setminus(Set(Vec(Str(n))), Vec("01689"))) || !n; \\ A045574
    isok(n) = issquare(n) && isra(n); \\ Michel Marcus, Dec 30 2020

Formula

a(n) = A339996(n)^2.

A208646 Calendar Problem #27, April 2012 Mathematics Teacher.

Original entry on oeis.org

9861, -1986, 9681, -1896, 8961, -1968, 8691, -1698
Offset: 1

Views

Author

Jonathan Vos Post, Mar 01 2012

Keywords

Comments

The numbers are paired on the basis of rotational symmetry with alternating signs.

Examples

			If you rotate the first number, 9861, 180 degrees about its center, and put a negative sign in front, you get the second number: -1986. Similarly, the third and fourth numbers are rotations of each other, as well as of the fifth and sixth numbers.  Therefore the eighth number is the rotation and negation of the seventh number, 8961, which would be -1698.
		

Crossrefs

Showing 1-10 of 11 results. Next