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

A001232 Numbers k such that 9*k = (k written backwards), k > 0.

Original entry on oeis.org

1089, 10989, 109989, 1099989, 10891089, 10999989, 108901089, 109999989, 1089001089, 1098910989, 1099999989, 10890001089, 10989010989, 10999999989, 108900001089, 108910891089, 109890010989, 109989109989, 109999999989, 1089000001089, 1089109891089
Offset: 1

Views

Author

Keywords

Comments

This sequence contains the least n-digit non-palindromic number which is a factor of its reversal. Quotient is always 9. - Lekraj Beedassy, Jun 11 2004. (But it contains many other numbers as well. - N. J. A. Sloane, Jul 02 2013)
Nonzero fixed points of the map which sends x to x - reverse(x) if that is nonnegative, otherwise to x + reverse(x). - Sébastien Dumortier, Nov 05 2006. (Clarified comment, see A124074. - Ray Chandler, Oct 11 2017)
Numbers k such that reversal(k)=reversal(k+reversal(k)). Also numbers k such that reversal(k)=reversal(10*k-reversal(k)). - Farideh Firoozbakht, Jun 11 2010
From M. F. Hasler, Oct 04 2022: (Start)
(1) The first digit of any term must be 1, otherwise multiplication by 9 yields one more digit. For the same reason, no "overflow" must occur from the second to the first digit, so the last digit must be 9.
(2) Continuing the reasoning "from right to left" implies that the trailing nonzero digits must be ...9*89, where 9* means any nonnegative number of consecutive digits 9, preceded by a digit 0, which must be preceded by a digit 1. This implies that the initial and also final digits of any term must be 109*89. We might call a term of this form a "primitive" term. So there is exactly one primitive term b(k) = 11*10^(k-2)-11 with k digits, for all k >= 4.
(3) All terms of the sequence are a "symmetric" concatenation of such b(k)'s, "spaced out" with any number of digits 0, also in a symmetrical way: For any n >= 1, let k = (k[1], ..., k[n]) with k[n+1-j] = k[j] >= 4, and m = (m[1], ..., m[n-1]) (possibly of length 0) with m[n-j] = m[j] >= 0, then N = concat(b(k[j])*10^m[j], 1 <= j < n; k[n]) is a term of the sequence, and this yields all terms of the sequence. (For example, with 1089 we also have 1089{0...0}1089 and 1089,001089,001089, etc.) (End)

Examples

			1089*9 = 9801.
		

References

  • H. Camous, Jouer Avec Les Maths, "Cardinaux Réversibles", Section I, Problem 6, pp. 27, 37-38; Les Editions d'Organisation, Paris, 1984.
  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 41.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, under #1089.

Crossrefs

Programs

  • Mathematica
    Rest@Select[FromDigits /@ Tuples[{0, 99}, 11], IntegerDigits[9*#] == Reverse@IntegerDigits[#] &] (* Arkadiusz Wesolowski, Aug 14 2012 *)
    okQ[t_]:=t==Reverse[t]&&First[t]!=0&&Min[Length/@Split[t]]>1; 99#&/@Flatten[Table[ FromDigits/@ Select[Tuples[{0,1},n],okQ],{n,20}]] (* Harvey P. Dale, Jul 03 2013 *)
  • PARI
    isok(n) = 9*n == eval(concat(Vecrev(Str(n)))); \\ Michel Marcus, Feb 21 2015
    
  • PARI
    {A001232_row(n, L(v, s=0)=for(i=1, #v, s*=10^v[i]; i%2 && s+=10^v[i]\900); s)=if(n<4, [], L, Set(apply(L, self()(n, 0)))*99, L=List([[n]]); for(k=4, n\2, listput(L,[k,n-2*k,k]); for(p=0, n\2-k, foreach(self()(n-(k+p)*2, 0), M, listput(L, concat([[k, p], M, [p, k]]))))); L)} \\ List of n-digit terms. - M. F. Hasler, Oct 04 2022
    concat(apply(A001232_row, [1..14]))
    
  • Python
    def A001232_row(n, r=11): # list of n-digit terms
        L = [] if n<4 else [[n]]
        for L1 in range(4, n//2+1):
            L.append([L1, n-2*L1, L1])
            L.extend([L1,L2]+M+[L2,L1] for L2 in range(n//2-1-L1)
                                         for M in A001232_row(n-(L1+L2)*2, 0))
        if not r: return L
        def f(L, s=0):
            for k,L in enumerate(L):
                s *= 10**L
                if not k%2: s += 10**(L-2)-1
            return r*s
        return sorted(map(f, A001232_row(n, 0))) # M. F. Hasler, Oct 04 2022

Formula

Theorem: Terms in this sequence have the form 99*m, where the decimal representation of m contains only 1's and 0's, is palindromic and contains no singleton 1's or 0's. Hence contains Fib(floor(k/2)-1) k-digit terms, k >= 4. - David W. Wilson, Dec 15 1997
a(A094707(n)) = 11*(10^n - 1) = 11*A002283(n) = 99*A002275(n), for n>1. - Lekraj Beedassy, Jun 11 2004. (Restored from history and corrected. - Ray Chandler, Oct 11 2017)
a(n) = 99*A061851(n) = A008918(n)/2. - M. F. Hasler, Oct 06 2022

Extensions

Corrected and extended by David W. Wilson, Aug 15 1996, Dec 15 1997
a(20)-a(21) from Arkadiusz Wesolowski, Aug 14 2012
a(1..10^4) in b-file double-checked with independent code by M. F. Hasler, Oct 04 2022

A031877 Nontrivial reversal numbers (numbers which are integer multiples of their reversals), excluding palindromic numbers and multiples of 10.

Original entry on oeis.org

8712, 9801, 87912, 98901, 879912, 989901, 8799912, 9899901, 87128712, 87999912, 98019801, 98999901, 871208712, 879999912, 980109801, 989999901, 8712008712, 8791287912, 8799999912, 9801009801, 9890198901, 9899999901, 87120008712, 87912087912, 87999999912
Offset: 1

Views

Author

Keywords

Comments

The terms of this sequence are sometimes called palintiples.
All terms are of the form 87...12 = 4*21...78 or 98...01 = 9*10...89. [This was proved by Hoey, 1992. - N. J. A. Sloane, Oct 19 2014] More precisely, they are obtained from concatenated copies of either 8712 or 9801, with 9's inserted "in the middle of" these and/or 0's inserted between the copies these, in a symmetrical way. A008919 lists the reversals, but not in the same order, e.g., R(a(2)) < R(a(1)). - M. F. Hasler, Aug 18 2014
There are 2*Fibonacci(floor((n-2)/2)) terms with n digits (this is A214927 or essentially twice A103609). - Ray Chandler, Oct 11 2017

References

  • W. W. R. Ball and H. S. M. Coxeter. Mathematical Recreations and Essays (1939, page 13); 13th ed. New York: Dover, pp. 14-15, 1987.
  • G. H. Hardy, A Mathematician's Apology (Cambridge Univ. Press, 1940, reprinted 2000), pp. 104-105 (describes this problem as having "nothing in [it] which appeals much to a mathematician.").

Crossrefs

See A008919 for reversals (this is the main entry for the problem).
Union of A222814 and A222815.
Subsequence of A118959.

Programs

  • Haskell
    a031877_list = [x | x <- [1..], x `mod` 10 > 0,
                        let x' = a004086 x, x' /= x && x `mod` x' == 0]
    -- Reinhard Zumkeller, Jul 15 2013
    
  • Mathematica
    fQ[n_] := Block[{id = IntegerDigits@n}, Mod[n, FromDigits@ Reverse@id] == 0 && n != FromDigits@ Reverse@ id && Mod[n, 10] > 0]; k = 1; lst = {}; While[k < 10^9, If[fQ@k, AppendTo[lst, k]; Print@k]; k++ ]; lst (* Robert G. Wilson v, Jun 11 2010 *)
    okQ[t_]:=t==Reverse[t]&&First[t]!=0&&Min[Length/@Split[t]]>1; Sort[Flatten[ {(4*198)#,(9*99)#}&/@Flatten[Table[FromDigits/@Select[Tuples[ {0,1},n], okQ],{n,12}]]]] (* Harvey P. Dale, Jul 03 2013 *)
  • PARI
    is_A031877(n)={n%10 && n%A004086(n)==0 && n>A004086(n)} \\ M. F. Hasler, Aug 18 2014
    
  • Python
    A031877 = []
    for n in range(1,10**7):
        if n % 10:
            s1 = str(n)
            s2 = s1[::-1]
            if s1 != s2 and not n % int(s2):
                A031877.append(n) # Chai Wah Wu, Sep 05 2014

Formula

a(n) = A004086(a(n))*[9/(a(n)%10)], where [...]=9 if a(n) ends in "1" and [...]=4 if a(n) ends in "2". - M. F. Hasler, Aug 18 2014

Extensions

More terms from Jud McCranie, Aug 15 2001
More terms from Sam Mathers, Aug 18 2014

A008918 Numbers k such that 4*k = (k written backwards), k > 0.

Original entry on oeis.org

2178, 21978, 219978, 2199978, 21782178, 21999978, 217802178, 219999978, 2178002178, 2197821978, 2199999978, 21780002178, 21978021978, 21999999978, 217800002178, 217821782178, 219780021978, 219978219978, 219999999978, 2178000002178, 2178219782178
Offset: 1

Views

Author

Keywords

Comments

There are Fibonacci(floor((k-2)/2)) terms with k digits (this is essentially A103609). - Ray Chandler, Oct 12 2017

References

  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, pages 41-42.
  • D. Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986.

Crossrefs

Programs

  • Mathematica
    Rest@Select[FromDigits /@ Tuples[{0, 198}, 11], IntegerDigits[4*#] == Reverse@IntegerDigits[#] &] (* Arkadiusz Wesolowski, Aug 14 2012 *)
    okQ[t_]:=t==Reverse[t]&&First[t]!=0&&Min[Length/@Split[t]]>1; 198#&/@ Flatten[ Table[FromDigits/@Select[Tuples[{0,1},n],okQ],{n,20}]] (* Harvey P. Dale, Jul 03 2013 *)
  • PARI
    rev(n) = (eval(concat(Vecrev(Str(n)))));
    isok(n) = rev(n) == 4*n; \\ Michel Marcus, Sep 13 2015

Formula

Theorem (David W. Wilson): a(n) = 2*A001232(n).

Extensions

Corrected and extended by David W. Wilson Aug 15 1996, Dec 15 1997
a(20)-a(21) from Arkadiusz Wesolowski, Aug 14 2012

A061851 Digital representation of n contains only 1's and 0's, is palindromic and contains no singleton 1's or 0's.

Original entry on oeis.org

11, 111, 1111, 11111, 110011, 111111, 1100011, 1111111, 11000011, 11100111, 11111111, 110000011, 111000111, 111111111, 1100000011, 1100110011, 1110000111, 1111001111, 1111111111, 11000000011, 11001110011, 11100000111, 11110001111, 11111111111, 110000000011, 110001100011
Offset: 1

Views

Author

Henry Bottomley, May 10 2001

Keywords

Comments

The terms can be constructed by gluing together terms from A355280 with their reversal as follows: The terms with odd length L = 2k-1 are given from the k-digit terms of A355280 by replacing the last digit with the reversal of the term. (Equivalently, concatenate with the reversal and delete one of the middle digits.) Terms with an even number L = 2k of digits are given as concatenation(m, reverse(m)) = m*10^L(m) + A004086(m) where m runs over the k-digit terms from A355280, and the (k-1)-digit terms with the 1's complement of the last digit appended. This explains the formula given in CROSSREFS for the number of terms of given length. - M. F. Hasler, Oct 17 2022

Crossrefs

Number of terms with k digits is Fibonacci(floor(k/2)) = A000045(A004526(k)).
Union of this sequence and twice this sequence is A061852 and 99 times that is A008919.
Cf. A214927, A001232, A222814, A008918, A008919, A222813 (terms converted to decimal).
Cf. A355280 (palindromic binary numbers with no digit run of length < 2).

Programs

  • PARI
    concat(apply( {A061851_row(n)=[fromdigits(binary(m))|m<-A222813_row(n)]}, [1..11])) \\ M. F. Hasler, Oct 17 2022
    
  • Python
    def A061851_row(n): return [] if n < 2 else [10**n//9] if n < 6 else [
        m*10**(n//2) + A004086(m//10) for m in A355280_row(n//2+1)] if n&1 else [
        m*10**(n//2) + A004086(m) for m in sorted(A355280_row(n//2)+
                            [x*10+1-x%10 for x in A355280_row(n//2-1)])]
    # M. F. Hasler, Oct 17 2022

Formula

a(n) = A001232(n)/99 = A008918(n)/198.
a(n) = A007088(A222813(n)), where A007088 = write in binary. - M. F. Hasler, Oct 06 2022

A071685 Non-palindromic numbers n, not divisible by 10, such that either n divides R(n) or R(n) divides n, where R(n) is the digit-reversal of n.

Original entry on oeis.org

1089, 2178, 8712, 9801, 10989, 21978, 87912, 98901, 109989, 219978, 879912, 989901, 1099989, 2199978, 8799912, 9899901, 10891089, 10999989, 21782178, 21999978, 87128712, 87999912, 98019801, 98999901, 108901089, 109999989
Offset: 1

Views

Author

Labos Elemer, Jun 03 2002

Keywords

Comments

The quotient R(n)/n or n/R(n) is always 4 or 9.
This is the union of the four sequence A001232, A222814, A008918, A222815. Equivalently, the union of A008919 and A031877.
There are 4*Fibonacci(floor((n-2)/2)) terms with n digits (this is 2*A214927 or essentially 4*A103609). - Ray Chandler, Oct 12 2017
Conjecture: every term mod 100 is equal to 1, 12, 78, or 89. - Harvey P. Dale, Dec 13 2017

Examples

			Palindromic solutions like 12021 or also solutions divisible by 10 were filtered out like {8380,838; q=10} or {8400,48; q=175}. In case of m>R(m), q=m/R(m)=4 or 9.
		

Crossrefs

Programs

  • Mathematica
    nd[x_, y_] := 10*x+y tn[x_] := Fold[nd, 0, x] ed[x_] := IntegerDigits[x] red[x_] := Reverse[IntegerDigits[x]] Do[s=Mod[Max[{n, tn[red[n]]}], Min[{n, r=tn[red[n]]}]]; If[Equal[s, 0]&&!Equal[Mod[n, 10], 0] &&!Equal[n, r], Print[{n, r/n}]], {n, 1, 1000000}]
    npnQ[n_]:=Module[{r=IntegerReverse[n]},!PalindromeQ[n]&&!Divisible[ n,10] &&(Mod[n,r]==0||Mod[r,n]==0)]; Select[Range[11*10^7],npnQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 13 2017 *)

Formula

x = q*R(x), q is an integer q<>1, q<>10^j and neither of x or R(x) is divisible by 10.

Extensions

Corrected and extended by Harvey P. Dale, Jul 01 2013
Edited by N. J. A. Sloane, Jul 02 2013
Missing terms inserted by Ray Chandler, Oct 09 2017
Incorrect comment removed by Ray Chandler, Oct 12 2017

A243097 Digit sums of the nontrivial reversal numbers (numbers which are integer multiples of their reversal), excluding palindromes and multiples of 10.

Original entry on oeis.org

18, 18, 27, 27, 36, 36, 45, 45, 36, 54, 36, 54, 36, 63, 36, 63, 36, 54, 72, 36, 54, 72, 36, 54, 81, 36, 54, 81, 36, 54, 54, 72, 90, 36, 54, 54, 72, 90, 36, 63, 54, 72, 99, 36, 63, 54, 72, 99, 36, 54, 72, 54, 72, 72, 90, 108, 36, 54, 72, 54, 72, 72, 90, 108
Offset: 1

Views

Author

Sam Mathers, Aug 18 2014

Keywords

Examples

			a(1)=digit sum of 8712=8+7+1+2=18, a(3)=digit sum of 87912=8+7+9+1+2=27.
		

Crossrefs

Cf. A007953 (digit sum), A031877 (union of A222814 and A222815).

Programs

  • Python
    A243097 = []
    for n in range(1,10**7):
        if n % 10:
            s1 = str(n)
            s2 = s1[::-1]
            if s1 != s2 and not n % int(s2):
                A243097.append(sum(int(d) for d in s1))
    # Chai Wah Wu, Sep 05 2014

Formula

a(n) = 9(d-2p-b) where d is the number of digits in the reversal number, p is the number of repeating units of either 8712 or 9801 (they can be split in the middle of the sequence as long as all 4 numbers appear in the correct order), and b is the number of digits separating two complete "units" (must appear between two complete units and not in between 1 incomplete unit).
a(n) = A007953(A031877(n)).

Extensions

More terms from Michel Marcus, Aug 25 2014
Showing 1-6 of 6 results.