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-4 of 4 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

A061852 Digital representation of m contains only either 1's or 2's (but not both 1's and 2's) and 0's, is palindromic and contains no singleton 2's, 1's or 0's.

Original entry on oeis.org

11, 22, 111, 222, 1111, 2222, 11111, 22222, 110011, 111111, 220022, 222222, 1100011, 1111111, 2200022, 2222222, 11000011, 11100111, 11111111, 22000022, 22200222, 22222222, 110000011, 111000111, 111111111, 220000022, 222000222
Offset: 1

Views

Author

Henry Bottomley, May 10 2001

Keywords

Examples

			From _M. F. Hasler_, Oct 17 2022: (Start)
Written in rows, where each row has terms of given length and given digit set (either no 2 or no 1), the sequence starts:
  row | terms
------+------------------------------------
    1 | 11
    2 | 22
    3 | 111
    4 | 222
    5 | 1111
    6 | 2222
    7 | 11111
    8 | 22222
    9 | 110011, 111111
   10 | 220022, 222222
Then for any n >= 1, row 2n = 2*(row 2n-1) and row 2n-1 = (terms in A061851 with n+1 digits), and the number of terms in row n is Fibonacci(ceiling(n/4)) = A000045(A002265(n+3)), and their length (number of digits) is ceiling(n/2)+1 = floor((n+3)/2). (End)
		

Crossrefs

Cf. A008919.
Union of A061851 and twice A061851.
Number of terms with k digits is 2*Fibonacci(floor(k/2)) = 2*A000045(A004526(k)) = A006355(floor(k/2)+1).

Programs

  • PARI
    A061852_row(n)=A061851_row(n\/2+1)*(2-n%2) \\ Note: This refers to rows as defined in EXAMPLE, while A061851_row gives the n-digit terms. - M. F. Hasler, Oct 17 2022

Formula

a(n) = A008919(n)/99.

A222813 Numbers whose binary representation is palindromic and in which all runs of 0's and 1's have length at least 2.

Original entry on oeis.org

3, 7, 15, 31, 51, 63, 99, 127, 195, 231, 255, 387, 455, 511, 771, 819, 903, 975, 1023, 1539, 1651, 1799, 1935, 2047, 3075, 3171, 3315, 3591, 3687, 3855, 3999, 4095, 6147, 6371, 6643, 7175, 7399, 7695, 7967, 8191, 12291, 12483, 12771, 13107, 13299, 14343, 14535, 14823, 15375, 15567, 15903, 16191, 16383, 24579
Offset: 1

Views

Author

N. J. A. Sloane, Mar 11 2013

Keywords

Comments

These are the decimal representations of A061851 read as base-2 numbers.
The terms with an odd number L = 2k-1 of bits, i.e., 2^(L-1) < a(n) < 2^L, are given by the terms of A033015 with length k, shifted k-1 digits to the left and 'OR'ed with the binary reversal of the term. Terms with an even number L = 2k of digits are given as m*2^k + (binary reversal of m) where m runs over the k-bit terms from A033015 and the k-1 bit terms with the last bit negated appended). This explains the FORMULA for the number of terms of given size. - M. F. Hasler, Oct 17 2022

Examples

			51 (base 10) = 110011 (base 2), which is a palindrome and has three runs all of length 2.
		

Crossrefs

Cf. A061851.
Cf. A006995 (binary palindromes), A033015 (no isolated binary digit), A028897 ("rebase" 10 -> 2).

Programs

  • Mathematica
    brpalQ[n_]:=Module[{idn2=IntegerDigits[n,2]},idn2==Reverse[idn2] && Min[ Length/@ Split[idn2]]>1]; Select[Range[25000],brpalQ] (* Harvey P. Dale, May 21 2014 *)
  • PARI
    is(n)=is_A033015(n)&&Vecrev(n=binary(n))==n \\ M. F. Hasler, Oct 06 2022
    
  • PARI
    {A222813_row(n, s=A033015_row(n\/2))=apply(A030101, if(n%2, s\2, n>2, s=setunion([k*2+1-k%2|k<-A033015_row(n\2-1)],s), s=[1]))+s<<(n\2)} \\ Terms with n bits, i.e. between 2^(n-1) and 2^n. - M. F. Hasler, Oct 17 2022

Formula

From M. F. Hasler, Oct 06 2022: (Start)
Intersection of A006995 and A033015: binary palindromes with no isolated digit.
There are A000045(A004526(k)) = Fibonacci(floor(k/2)) terms between 2^(k-1) and 2^k.
a(n) = A028897(A061851(n)), where A028897 = convert binary to decimal. (End)

A355280 Binary numbers (digits in {0, 1}) with no run of digits with length < 2.

Original entry on oeis.org

11, 111, 1100, 1111, 11000, 11100, 11111, 110000, 110011, 111000, 111100, 111111, 1100000, 1100011, 1100111, 1110000, 1110011, 1111000, 1111100, 1111111, 11000000, 11000011, 11000111, 11001100, 11001111, 11100000, 11100011, 11100111, 11110000, 11110011, 11111000, 11111100, 11111111
Offset: 1

Views

Author

M. F. Hasler, Oct 17 2022

Keywords

Comments

This is the binary representation of the terms in A033015.
The sequence can be seen as a table where row r contains the terms with r digits. Then row r+1 is obtained by from the terms of row r by duplicating their last digit, and from those of row r-1 by appending twice the 1's complement of their last digit. This yields the row lengths given in FORMULA.

Examples

			There can't be a terms with only 1 digit, so the smallest term is a(1) = 11.
The only 3-digit term is a(2) = 111, since in 100 the digit 1 is alone, and in 101 and 110 the digit 0 is alone.
With four digits we must have either no or two digits 0 and they must be at the end (to avoid isolated '1's), i.e., a(3) = 1100 and a(4) = 1111.
		

Crossrefs

Cf. A033015 (the same terms converted from base 2 to base 10),
Subsequence of A007088 (the binary numbers); A000042 (numbers in base 1) = A002275 \ {0} (repunits) are subsequences; A061851 is the subsequence of palindromes.

Programs

  • Maple
    F:= proc(d) option remember;
       local R,i,j, x0;
       R:= NULL;
       for i from d-2 to 2 by -1 do
         x0:= (10^d - 10^i)/9;
         for j from i-2 to 0 by -1 do
            R:= R, op(map(t -> t + x0, procname(j)))
         od
       od;
       sort([R, (10^d-1)/9])
    end proc:
    F(0):= [0]; F(1):= [];
    seq(op(F[i]),i=2..9); # Robert Israel, May 12 2025
  • PARI
    {is_A355280(n,d=digits(n))=vecmax(d)==1 && is_A033015(fromdigits(d,2))}
    A355280(n)=A007088(A033015(n))
    concat(apply( {A355280_row(n)=if(n>2, setunion([x*10+x%10|x<-A355280_row(n-1)],[x*100+11*(1-x%10)|x<-A355280_row(n-2)]), n>1, [11],[])}, [1..8])) \\ "Row" of n-digit terms. For (very) large n one should implement memoization instead of this naive recursion.
    
  • Python
    def A355280_row(n): return [] if n<2 else [11] if n==2 else sorted(
        [x*10+x%10 for x in A355280_row(n-1)] +
        [x*100+11-x%10*11 for x in A355280_row(n-2)]) # M. F. Hasler, Oct 17 2022

Formula

a(n) = A007088(A033015(n)).
The number of terms with n digits is Fibonacci(n-1); the largest such term is A000042(n) = A002275(n).
Showing 1-4 of 4 results.