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.

Previous Showing 11-20 of 26 results. Next

A278328 Numbers n such that abs(n - rev(n)) is a square, where rev(n) is the decimal reverse of n (A004086).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 21, 22, 23, 26, 32, 33, 34, 37, 40, 43, 44, 45, 48, 51, 54, 55, 56, 59, 62, 65, 66, 67, 73, 76, 77, 78, 84, 87, 88, 89, 90, 95, 98, 99, 101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 202, 212, 222, 232, 242, 252, 262
Offset: 1

Views

Author

Jonathan Frech, Nov 18 2016

Keywords

Comments

All palindromes are in this sequence, hence it is infinite.

Crossrefs

A002113 is a subsequence.

Programs

  • Maple
    a:= proc(n) option remember; local k; for k from 1+
          `if`(n=1, -1, a(n-1)) while not issqr(abs(k-(s->
           parse(cat(s[-i]$i=1..length(s))))(""||k))) do od: k
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Nov 18 2016
  • Mathematica
    Select[Range@ 262, IntegerQ@ Sqrt@ Abs[# - FromDigits@ Reverse@ IntegerDigits@ #] &] (* Michael De Vlieger, Nov 18 2016 *)
  • PARI
    is(n) = issquare(abs(n - eval(concat(Vecrev(Str(n)))))) \\ Felix Fröhlich, Nov 18 2016
    
  • PARI
    is(n, {b=10}) = issquare(abs(n - subst(Polrev(digits(n, b),'x),'x,b))); \\ Gheorghe Coserea, Nov 27 2016
  • Python
    import math
    n = 0
    while True:
        if math.sqrt(abs(n-int(str(n)[::-1])))%1 == 0:
            print(n)
        n += 1 # Jonathan Frech, Nov 18 2016
    

A335978 Numbers m of the form abs(k - reverse(k)) for at least one k.

Original entry on oeis.org

0, 9, 18, 27, 36, 45, 54, 63, 72, 81, 90, 99, 180, 189, 198, 270, 279, 297, 360, 369, 396, 450, 459, 495, 540, 549, 594, 630, 639, 693, 720, 729, 792, 810, 819, 891, 900, 909, 990, 999, 1089, 1179, 1188, 1269, 1278, 1359, 1368, 1449, 1458, 1539, 1548, 1629, 1638, 1719, 1728, 1800, 1809, 1818, 1890, 1908, 1980, 1989, 1998, 2079
Offset: 1

Views

Author

Michael Greaney, Jul 03 2020

Keywords

Comments

All terms are divisible by 9.
Let f(k) = k - reverse(k). Then f(reverse(k)) = -f(k), since f(reverse(k)) = reverse(k) - reverse(reverse(k)) = reverse(k) - k = - (k - reverse(k)) = -f(k).
Iteration of the function f(k) = k - reverse(k) leads to A072140, A072141, A072142, and A072143.

Crossrefs

Dividing by 9 gives A334145.

A338827 For any number with decimal representation (d(1), d(2), ..., d(k)), the decimal representation of a(n) is (abs(d(1)-d(k)), abs(d(2)-d(k-1)), ..., abs(d(k)-d(1))).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 11, 22, 33, 44, 55, 66, 77, 88, 22, 11, 0, 11, 22, 33, 44, 55, 66, 77, 33, 22, 11, 0, 11, 22, 33, 44, 55, 66, 44, 33, 22, 11, 0, 11, 22, 33, 44, 55, 55, 44, 33, 22, 11, 0, 11, 22, 33, 44, 66, 55, 44, 33, 22, 11, 0, 11, 22
Offset: 0

Views

Author

Rémy Sigrist, Nov 11 2020

Keywords

Comments

Leading zeros are ignored.
All terms belong to A061917.

Examples

			For n = 1021:
- abs(1-1) = 0,
- abs(0-2) = 2,
- abs(2-0) = 2,
- abs(1-1) = 0,
- so a(1021) = 220.
		

Crossrefs

Cf. A002113, A004086, A056965, A061917, A175919 (binary analog), A330240, A338828 (ternary analog).

Programs

  • Maple
    a:= n-> (l-> (h-> add(h[j]*10^(j-1), j=1..nops(h)))([seq(
        abs(l[i]-l[-i]), i=1..nops(l))]))(convert(n, base, 10)):
    seq(a(n), n=0..70);  # Alois P. Heinz, Nov 12 2020
  • PARI
    a(n, base=10) = my (d=digits(n, base)); fromdigits(abs(d-Vecrev(d)), base)

Formula

a(n) = 0 iff n is a palindrome (A002113).
a(n) = A330240(n, A004086(n)).

A349240 a(n) = n - (reversal of digits in the Zeckendorf representation of n).

Original entry on oeis.org

0, 0, 1, 2, 0, 4, 0, 3, 7, 0, 4, 7, 0, 12, 0, 6, 10, -2, 14, 2, 8, 20, 0, 9, 15, -5, 20, 0, 9, 25, 5, 14, 20, 0, 33, 0, 14, 23, -10, 30, -3, 11, 36, 3, 17, 26, -7, 43, 10, 24, 33, 0, 40, 7, 21, 54, 0, 22, 36, -18, 46, -8, 14, 54, 0, 22, 36, -18, 62, 8, 30, 44
Offset: 0

Views

Author

Kevin Ryde, Nov 11 2021

Keywords

Crossrefs

Cf. A189920 (Zeckendorf digits), A349238 (reverse), A349239 (reverse and add).
Cf. A094202 (indices of 0's).
Other bases: A055945 (binary), A056965 (decimal).

Programs

  • PARI
    \\ See links.
    
  • Python
    # Using functions NumToFib and RevFibToNum from A349238.
    n, a = 0, 0
    print(a - a, end = ", ")
    while n < 71:
        n += 1
        print(n - RevFibToNum(NumToFib(n)), end = ", ") # A.H.M. Smeets, Nov 14 2021

Formula

a(n) = n - A349238(n).
a(n) = 2*n - A349239(n).

A055949 n - reversal of base 4 digits of n (written in base 10).

Original entry on oeis.org

0, 0, 0, 0, 3, 0, -3, -6, 6, 3, 0, -3, 9, 6, 3, 0, 15, 0, -15, -30, 15, 0, -15, -30, 15, 0, -15, -30, 15, 0, -15, -30, 30, 15, 0, -15, 30, 15, 0, -15, 30, 15, 0, -15, 30, 15, 0, -15, 45, 30, 15, 0, 45, 30, 15, 0, 45, 30, 15, 0, 45, 30, 15, 0, 63, 0, -63, -126, 51, -12, -75, -138, 39, -24, -87, -150, 27, -36, -99, -162, 75, 12, -51
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

a(n) is a multiple of 3.

Examples

			For n = 6, the reversal of base 4 digits of n (written in base 10) is 9. So, a(6) = 6 - 9 = -3. - _Indranil Ghosh_, Feb 01 2017
		

Crossrefs

Programs

  • Mathematica
    Table[n-FromDigits[Reverse[IntegerDigits[n,4]],4],{n,0,90}] (* Harvey P. Dale, Aug 22 2011 *)

Formula

a(n) = n - A030103(n).

A055951 n - reversal of base 5 digits of n (written in base 10).

Original entry on oeis.org

0, 0, 0, 0, 0, 4, 0, -4, -8, -12, 8, 4, 0, -4, -8, 12, 8, 4, 0, -4, 16, 12, 8, 4, 0, 24, 0, -24, -48, -72, 24, 0, -24, -48, -72, 24, 0, -24, -48, -72, 24, 0, -24, -48, -72, 24, 0, -24, -48, -72, 48, 24, 0, -24, -48, 48, 24, 0, -24, -48, 48, 24, 0, -24, -48, 48, 24, 0, -24, -48, 48, 24, 0, -24, -48, 72, 48, 24, 0, -24, 72, 48, 24, 0
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

a(n) is a multiple of 4.

Crossrefs

Programs

  • Mathematica
    Table[n - IntegerReverse[n, 5], {n, 0, 100}] (* Paolo Xausa, Aug 08 2024 *)

Formula

a(n) = n - A030104(n).

A055953 n - reversal of base 6 digits of n (written in base 10).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 5, 0, -5, -10, -15, -20, 10, 5, 0, -5, -10, -15, 15, 10, 5, 0, -5, -10, 20, 15, 10, 5, 0, -5, 25, 20, 15, 10, 5, 0, 35, 0, -35, -70, -105, -140, 35, 0, -35, -70, -105, -140, 35, 0, -35, -70, -105, -140, 35, 0, -35, -70, -105, -140, 35, 0, -35, -70, -105, -140, 35, 0, -35, -70, -105, -140, 70, 35, 0, -35, -70
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

a(n) is a multiple of 5.

Crossrefs

Programs

  • Mathematica
    Table[n - IntegerReverse[n, 6], {n, 0, 100}] (* Paolo Xausa, Aug 08 2024 *)

Formula

a(n) = n - A030105(n).

A055961 a(n) = n - (reversal of base-11 digits of n) (written in base 10).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, -10, -20, -30, -40, -50, -60, -70, -80, -90, 20, 10, 0, -10, -20, -30, -40, -50, -60, -70, -80, 30, 20, 10, 0, -10, -20, -30, -40, -50, -60, -70, 40, 30, 20, 10, 0, -10, -20, -30, -40, -50, -60, 50, 40, 30, 20, 10, 0, -10, -20, -30, -40, -50, 60, 50, 40, 30, 20, 10, 0, -10, -20, -30, -40
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

a(n) is a multiple of 10.

Crossrefs

Cf. A056960 (base-11 reversal), A056965 (n minus decimal reversal).

Programs

  • Maple
    f:= proc(n) local L,t;
      L:= convert(n,base,11);
      n - add(L[-i]*11^(i-1),i=1..nops(L))
    end proc:
    map(f, [$0..100]); # Robert Israel, Apr 20 2021
  • Mathematica
    Table[n-FromDigits[Reverse[IntegerDigits[n,11]],11],{n,0,80}] (* Harvey P. Dale, Feb 21 2023 *)
  • PARI
    a(n) = n - fromdigits(Vecrev(digits(n, 11)), 11); \\ Michel Marcus, Apr 22 2021

Formula

a(n) = n - A056960(n).

A055963 n - reversal of base 12 digits of n (written in base 10).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, -11, -22, -33, -44, -55, -66, -77, -88, -99, -110, 22, 11, 0, -11, -22, -33, -44, -55, -66, -77, -88, -99, 33, 22, 11, 0, -11, -22, -33, -44, -55, -66, -77, -88, 44, 33, 22, 11, 0, -11, -22, -33, -44, -55, -66, -77, 55, 44, 33, 22, 11, 0, -11, -22, -33, -44, -55, -66, 66, 55, 44
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

a(n) is a multiple of 11.

Crossrefs

Programs

  • Mathematica
    Table[n - IntegerReverse[n, 12], {n, 0, 100}] (* Paolo Xausa, Aug 08 2024 *)

Formula

a(n) = n - A056961(n).

A383887 Smallest non-palindromic number that is congruent to its reverse mod n.

Original entry on oeis.org

10, 13, 10, 15, 16, 13, 18, 19, 10, 1011, 100, 15, 1017, 1027, 16, 1025, 1039, 13, 1048, 1021, 18, 103, 1026, 19, 1026, 1017, 14, 1033, 1013, 1011, 1068, 1049, 100, 1039, 1046, 15, 1000, 1055, 1017, 1041, 1066, 1027, 1048, 105, 16, 1077, 1032, 1025, 1014, 1051, 1039, 1017, 1103, 17, 106, 1065
Offset: 1

Views

Author

Erick B. Wong, May 29 2025, at the suggestion of Lanny Wong

Keywords

Comments

Comparable to A070837, but such a number provably exists: if n is coprime to 10 then take 10^k where k is the order of 10 mod n; else take a>b>0 such that n divides 10^a - 10^b, then the number 10^(a+b) + 10^b + 1 works.
The n-th term in this sequence is equal to the first nonzero term of A070837 that occurs at an index divisible by n/gcd(n,9).

Examples

			For n=6, a(6)=13 is congruent to 31 mod 6.
For n=10, note that any number of 3 or fewer digits is necessarily a palindrome if the first digit equals the last, and 1011 is the first 4-digit non-palindrome.
		

Crossrefs

Programs

  • Mathematica
    seq[len_] := Module[{s = Table[0, {len}], c = 0, k = 9, d}, While[c < len, k++; krev = IntegerReverse[k]; If[k != krev, d = Select[Divisors[Abs[k - krev]], # <= len &]; Do[If[s[[d[[i]]]] == 0, s[[d[[i]]]] = k; c++], {i, 1, Length[d]}]]]; s]; seq[60] (* Amiram Eldar, May 31 2025 *)
  • PARI
    a(n) = my(k=1, d=digits(k), rd=Vecrev(d)); while(!((d != rd) && Mod(fromdigits(rd), n) == k), k++; d=digits(k); rd=Vecrev(d)); k; \\ Michel Marcus, May 30 2025
  • Python
    from functools import partial
    from itertools import count
    def accept(mod, k):
        r = int(str(k)[::-1])
        return r != k and (r-k) % mod == 0
    def a(n):
        return next(filter(partial(accept, n), count(10)))
    print([a(n) for n in range(1,57)])
    
Previous Showing 11-20 of 26 results. Next