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 21-30 of 31 results. Next

A321541 a(0)=1; thereafter a(n) = 3*a(n-1) with digits rearranged into nonincreasing order.

Original entry on oeis.org

1, 3, 9, 72, 621, 8631, 98532, 996552, 9986652, 99996552, 999986652, 9999996552, 99999986652, 999999996552, 9999999986652, 99999999996552, 999999999986652, 9999999999996552, 99999999999986652, 999999999999996552, 9999999999999986652, 99999999999999996552, 999999999999999986652
Offset: 0

Views

Author

N. J. A. Sloane, Nov 19 2018

Keywords

Comments

In contrast to A321542, this sequence increases forever.
Proof: The terms from a(7) onwards can be described as follows:
3 times the number 9 (2k times) 6552 is 2 9 (2k-1 times) 89656 which becomes 9 (2k times) 86652 when sorted;
then 3 times the number 9 (2k times) 86652 is 2 9 (2k times) 59956 which becomes 9 (2k+2 times) 6552 when sorted. QED

Crossrefs

The following are parallel families: A000079 (2^n), A004094 (2^n reversed), A028909 (2^n sorted up), A028910 (2^n sorted down), A036447 (double and reverse), A057615 (double and sort up), A263451 (double and sort down); A000244 (3^n), A004167 (3^n reversed), A321540 (3^n sorted up), A321539 (3^n sorted down), A163632 (triple and reverse), A321542 (triple and sort up), A321541 (triple and sort down).

Programs

  • Mathematica
    NestList[FromDigits[ReverseSort[IntegerDigits[3*#]]] &, 1, 25] (* Paolo Xausa, Aug 02 2024 *)

Formula

From Chai Wah Wu, Nov 20 2018: (Start)
a(n) = 10*a(n-1) + a(n-2) - 10*a(n-3) for n > 9.
G.f.: (118800*x^9 + 8910*x^8 + 8811*x^7 + 12321*x^6 + 2439*x^5 - 78*x^4 - 11*x^3 - 22*x^2 - 7*x + 1)/((x - 1)*(x + 1)*(10*x - 1)). (End)

A071586 Powers of 8 written backwards.

Original entry on oeis.org

1, 8, 46, 215, 6904, 86723, 441262, 2517902, 61277761, 827712431, 4281473701, 2954399858, 63767491786, 888318557945, 4011156408934, 23888027348153, 656017679474182, 8425863189971522, 48918490589341081, 278558570881511441
Offset: 0

Views

Author

Benoit Cloitre, Jun 01 2002

Keywords

Crossrefs

Programs

  • PARI
    for(i=1,50,n=8^i; s=ceil(log(n)/log(10)); print1(sum(i=0,s,10^(s-i-1)*(floor(n/10^i)-10*floor(n/10^(i+1)))),","))

A158625 Lower limit of backward value of 5^n.

Original entry on oeis.org

5, 2, 1, 3, 0, 2, 3, 3, 0, 4, 3, 1, 1, 3, 1, 1, 2, 4, 2, 1, 0, 3, 1, 3, 3, 0, 0, 0, 2, 3, 1, 4, 1, 0, 2, 1, 0, 3, 4, 3, 0, 2, 1, 2, 2, 1, 1, 4, 4, 3, 4, 0, 2, 0, 4, 0, 2, 2, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 3, 3, 2, 0, 1, 1, 4, 4, 2, 0, 1, 4, 2, 4, 1, 2, 0, 4
Offset: 1

Views

Author

Simon Plouffe, Mar 23 2009

Keywords

Comments

Digits are all in {0,1,2,3,4} after the first term.
The upper limit is A158624, 0.5265679578796997657885576975995789586775656...
The sequence is not eventually periodic. Assuming any period results in a condition a(1)=0 mod 10 which contradicts a(1)=5. - Cezary Glowacz, Jul 22 2024

Examples

			5^3 = 125 so the backward value is 0.521, 5^10 = 9765625, so backward value is 0.5265679. The lower limit of all values is a constant, which appears to be 0.521302330431131124210313300023141021034302...
From _N. J. A. Sloane_, May 11 2018: (Start)
To describe this another way:  write down the decimal expansion of powers of 5:
  1
  5
  25
  125
  625
  3125
  ...
keep going forever.
Write them backwards:
  1
  5
  52
  526
  5213
  ...
After a while the beginning digits are all the same.
That's the sequence. (End)
		

Crossrefs

Programs

  • Magma
    D:=87; e:=6; for d in [2..D-1] do t:=Modexp(5,e,10^(d+1)); if t div 10^d ge 5 then e+:=2^(d-2); end if; end for; t:=Modexp(5,e,10^D); IntegerToSequence(t,10); // Jon E. Schoenfield, Feb 05 2018
  • Python
    # lower limit of backward sequence of 5^n
    a,i=5,0; x=a
    while i < 100:
         i+=1; print(x, end=',')
         x=(-a//pow(5,i)*pow(3,i))%5; a+=x*pow(10,i)
    # Cezary Glowacz, Jul 29 2024
    

Formula

a(n) >= 0 and is the minimum satisfying (Sum_{i=1..n} a(i)*10^(i-1)) == 0 (mod 5^n), for n >= 2. - Cezary Glowacz, Jul 24 2024

A034906 Powers of 2 written backwards and sorted.

Original entry on oeis.org

1, 2, 4, 8, 23, 46, 61, 215, 652, 821, 2918, 4201, 6904, 8402, 48361, 63556, 86723, 270131, 441262, 882425, 2517902, 4034914, 6758401, 8068838, 23445533, 46880176, 61277761, 219078635, 654534862
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Sort[FromDigits[Reverse[IntegerDigits[#]]]&/@(2^Range[0,30])] (* Harvey P. Dale, Mar 06 2012 *)
    IntegerReverse[#]&/@(2^Range[0,30])//Sort (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 03 2020 *)

A341707 a(n) is the binary representation of n converted to yranib.

Original entry on oeis.org

0, 1, 2, 1, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, -38, -39, -40, -41, -42, -43, -44, -45, -46, -47, -48, -49, -50, -51, -52, -53, 46, 45, 44, 43, 42, 41
Offset: 0

Views

Author

N. J. A. Sloane, Feb 18 2021

Keywords

Comments

If n = Sum_{i=0..k} b_i*2^i, b_i = 0 or 1, b_k = 1, then a(n) = y(k) - Sum_{i=0..k-1} b_i*y(i), where y(j) = A004094(j) = 2^j written backwards in base 10.
If the 2^14 terms from a(16384) to a(32767) were to be considered a packet [call it #1], then the terms from a(32768) to a(49151) [call it #2] are #1 + 38362. #3 = #2 - 48361 (note that 48361 is the reverse of 16384). #4 = #3 + 25194. These successive displacements
(38362, -48361, 25194, -48361,
-38362, -48361, 341659, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, 369771, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, -71491, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, 909934, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, -71491, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, 27509, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, -71491, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, 6786009, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, -71491, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, 27509, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, -71491, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, 27608, -48361,
-38362, -48361, 71528, -48361, ...) fully describe the future of the sequence. Can we predict the values of the displacements from first principles? - Hans Havermann, Feb 24 2021

Examples

			If n = 48 = 110000_2, b_0 = ... = b_3 = 0, b_4 = b_5 = 1, so a(48) = A004094(5) - A004094(4) = 23 - 61 = -38, which is the first negative term (cf. A341708).
		

References

  • Eric Angelini, Posting to Math Fun Mailing List, Feb 18 2021

Crossrefs

Cf. A004094.
See A341708 for the negative terms.
See A341709 for a different version of a yranib sequence.

Programs

  • Mathematica
    {0}~Join~Array[Fold[Subtract, Reverse@ IntegerReverse[2^(-1 + Position[Reverse@ IntegerDigits[#, 2], 1][[All, 1]] )]] &, 69] (* Michael De Vlieger, Feb 25 2021 *)
  • PARI
    /* Get decimal value of yranib representation of n written in binary (i.e., write n in binary, e.g., 9[10] = 1001[2], then read this in the yranib system,where the k-th position from the right has value s*R(2^k) where R=reverse(= decimal value read from right to left) and s = -1 except for the largest k. */
    y2d(n)=if(n=binary(n),n[1]*=-1);-sum(k=0,#n-1,n[#n-k]*R(2^k))
    R(n)=fromdigits(Vecrev(digits(n)))
    apply(y2d, [0..99]) \\ M. F. Hasler, Feb 18 2021
    
  • Python
    def reverse(n):
        s = 0
        while n > 0:
            d, n = n%10, n//10
            s = 10*s+d
        return s
    def A341707(n):
        s, t = 0, 1
        while n > 0:
            b, n = n%2, n//2
            if n > 0:
                s, t = reverse(t*b)+s, 2*t
            else:
                s = reverse(t*b)-s
        return s # A.H.M. Smeets, Feb 18 2021

Extensions

Further terms from M. F. Hasler, Feb 18 2021

A071588 Powers of 6 written backwards.

Original entry on oeis.org

1, 6, 63, 612, 6921, 6777, 65664, 639972, 6169761, 69677001, 67166406, 650797263, 6332876712, 61049606031, 69046146387, 675489481074, 6547099011282, 63744495662961, 614866659955101, 694010047953906, 6792600448516563
Offset: 0

Views

Author

Benoit Cloitre, Jun 01 2002

Keywords

Crossrefs

Programs

  • Mathematica
    FromDigits[Reverse[IntegerDigits[#]]]&/@(6^Range[0,30]) (* Harvey P. Dale, Feb 02 2012 *)
  • PARI
    for(i=1,50,n=5^i; s=ceil(log(n)/log(10)); print1(sum(i=0,s,10^(s-i-1)*(floor(n/10^i)-10*floor(n/10^(i+1)))),","))

Formula

a(n) = A004086(A000400(n)).

A371880 Smallest number reachable starting from 1 and taking n steps either doubling or doubling+reversing.

Original entry on oeis.org

1, 2, 4, 8, 16, 23, 46, 29, 58, 71, 34, 68, 37, 47, 49, 89, 79, 59, 19, 38, 67, 35, 7, 14, 28, 56, 13, 26, 25, 5, 1, 2, 4, 8, 16, 23, 46, 29, 58, 17, 34, 68, 37, 47, 49, 89, 79, 59, 19, 38, 67, 35, 7, 14, 28, 56, 13, 26, 25, 5, 1, 2, 4, 8, 16, 23, 46, 29, 58, 17
Offset: 0

Views

Author

Bryle Morga, Apr 14 2024

Keywords

Comments

At each step you are allowed to either double x -> 2*x or double and reverse x -> R(2*x), where R(x) = A004086(x) is decimal digit reversal.
From Michael S. Branicky, Apr 14 2024: (Start)
Since a(30) = 1 = a(0), a(n) <= a(n-30) for n >= 30. a(39) <= 17 < a(9) = 71 is the first term that strictly lowers the bound. Is it eventually periodic?
Under the map, a term k has preimage k/2 if k is even plus terms of the form R(k)*10^i/2 for i > 1 and for i=0 if R(k) is even. (End)
The condition above implies a(i+30k) is nonincreasing for k >= 0 for all i in 0..29, hence it is periodic (with period being a factor of 30). When does the periodic part of the sequence begin? - Bryle Morga, Apr 15 2024
From David A. Corneth, Apr 15 2024: (Start)
a(n) == 2^n (mod 9).
Because of this, all values 1 <= a(n) <= 9 have a(n + 30*k) = a(n). That is a(30*k) = 1, a(30*k + 1) = 2, a(30*k + 2) = 4, a(30*k + 3) = 8, a(30*k + 22) = 7, a(30*k + 29) = 5, for k >= 0. (End)
Ultimately periodic sequence of period 30 with a(k+30)=a(k) for k != 9. - David Wilson, Apr 19 2024

Examples

			a(20) = 67 and here is the 20-move combination that reaches 67: 1, 2, 4, 8, 61, 221, 244, 884, 8671, 17342, 48643, 97286, 275491, 289055, 11875, 23750, 47500, 95000, 190000, 380000, 67.
a(21) = 35 and here is the 21-move combination that reaches 35: 1, 2, 4, 8, 61, 221, 244, 884, 8671, 17342, 48643, 97286, 275491, 289055, 11875, 23750, 47500, 95000, 91, 281, 265, 35.
a(30) = 1 using the path: 1, 2, 4, 8, 61, 122, 442, 488, 976, 2591, 2815, 365, 37, 47, 49, 98, 196, 392, 487, 479, 859, 1718, 3436, 2786, 2755, 155, 13, 26, 25, 5, 1. - _Michael S. Branicky_, Apr 14 2024
		

Crossrefs

Programs

  • PARI
    \\ See PARI link
  • Python
    def f(k, d):
          if d == 0:
                return k
          else:
                return min(f(2*k, d-1), f(int(str(2*k)[::-1]), d - 1))
    def a(n):
          return f(1, n)
    for n in range(25):
          print(a(n))
    
  • Python
    from itertools import islice
    def reverse(n): return int(str(n)[::-1])
    def agen(): # generator of terms
        reach = {1}
        while True:
            yield min(reach)
            newreach = set()
            for q in reach: newreach.update([2*q, reverse(2*q)])
            reach = newreach
    print(list(islice(agen(), 28))) # Michael S. Branicky, Apr 14 2024
    

Formula

a(n) = f(1, n) where f(k, 0) = k and f(k, n) = min(f(2*k, n-1), f(R(2*k), n-1)).
a(30k) = 1 for k >= 0. - Michael S. Branicky, Apr 14 2024
a(9) = 71. For k != 9, a(k) is the minimum of the positive residues mod 99 of 2^k and 10*2^k. - David Wilson, Apr 19 2024

Extensions

a(27)-a(34) from Michael S. Branicky, Apr 14 2024
a(35) and beyond from David Wilson, Apr 19 2024

A062018 a(n) = n^n written backwards.

Original entry on oeis.org

1, 4, 72, 652, 5213, 65664, 345328, 61277761, 984024783, 1, 116076113582, 6528440016198, 352295601578203, 61085552860021111, 573958083098398734, 61615590737044764481, 771467633688162042728, 42457573569257080464393
Offset: 1

Views

Author

Amarnath Murthy, Jun 01 2001

Keywords

Examples

			a(5) = 5213, as 5^5 = 3125.
		

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 1 to 50 do a := convert(n^n,base,10):b := add(10^(nops(a)- i)*a[i],i=1..nops(a)):printf(`%d,`,b); od:
  • Mathematica
    Table[IntegerReverse[n^n],{n,20}] (* Harvey P. Dale, Jul 31 2022 *)
  • PARI
    a(n) = { fromdigits(Vecrev(digits( n^n )))} \\ Harry J. Smith, Jul 29 2009

Formula

a(n) = A004086(n^n).

Extensions

More terms from Jason Earls and Vladeta Jovovic, Jun 01 2001

A103161 GCD of reverse(2^n) and reverse(2^(n+1)), where reverse(k) = A004086(k), the decimal representation of k read backwards.

Original entry on oeis.org

2, 4, 1, 1, 23, 1, 1, 1, 1, 4201, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 7, 1, 1, 1, 1, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 19, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 34, 1, 1, 1, 7, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Labos Elemer, Jan 25 2005

Keywords

Examples

			n=10: GCD of backward written powers of 2 is GCD(4201, 8402) = 4201 = a(10).
		

Crossrefs

Programs

  • Mathematica
    rd[x_] :=FromDigits[Reverse[IntegerDigits[x]]] Table[GCD[rd[2^w], rd[2^(w+1)]], {w, 1, 100}]
    GCD[IntegerReverse[#[[1]]],IntegerReverse[#[[2]]]]&/@ Partition[ 2^Range[110],2,1] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 24 2017 *)
  • PARI
    rev(n) = subst(Polrev(digits(n)), 'x, 10); \\ These two functions from Charles R Greathouse IV, Oct 20 2014
    A004094(n) = rev(2^n);
    A103161(n) = gcd(A004094(n),A004094(1+n)); \\ Antti Karttunen, Dec 07 2017

Formula

a(n) = gcd(A004094(n), A004094(n+1)).

A100825 In decimal representation: minimal number of editing steps (delete, insert, or substitute) to transform 2^n into its reversal.

Original entry on oeis.org

0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 2, 6, 6, 4, 6, 4, 4, 4, 4, 6, 6, 8, 6, 8, 8, 8, 8, 8, 8, 8, 6, 6, 10, 12, 12, 8, 10, 10, 12, 10, 10, 14, 14, 14, 12, 12, 14, 12, 10, 14, 14, 16, 16, 16, 18, 14, 16, 16, 16, 14, 18, 16, 18, 18, 18, 18, 18, 16, 20, 20, 18, 22, 22, 22, 20, 18, 20
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 06 2005

Keywords

Examples

			n=19: 2^19 = 524288=[5]24288 -> 824288=[]824288 ->
8824288=882428[8] -> 882428=88242[8] -> 882425=A004094(19):
a(19) = #{subst[5->8], ins[8], del[8], subst[8->5]} = 4.
		

Formula

a(n) = LevenshteinDistance(A000079(n), A004094(n)).
Previous Showing 21-30 of 31 results. Next