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

A331632 Distinct values of A055945 in order of their appearance as n grows.

Original entry on oeis.org

0, 1, 3, 7, 5, -2, 9, 2, 15, -6, 21, 6, 31, 17, -14, 27, -4, 13, -18, 35, 4, -10, 45, 14, 41, 10, 49, 18, 63, 33, -30, 51, -12, -42, 75, 12, 93, 30, 81, 105, 42, 127, 65, -62, 99, -28, 37, -90, 119, -8, 57, -70, 91, -36, 29, -98, 135, 8, 73, -54, 107, -20, -82
Offset: 1

Views

Author

Rémy Sigrist, Jan 23 2020

Keywords

Examples

			A055945 starts: 0, 0, 1, 0, 3, 0, 3, 0, 7, 0, 5, -2, 9, 2, 7, 0, 15, 0, ...
We keep:        0,    1,    3,          7,    5, -2, 9, 2,       15,    ...
		

Crossrefs

Programs

  • Mathematica
    DeleteDuplicates[Array[# - IntegerReverse[#, 2] &, 200]] (* Paolo Xausa, Apr 28 2025 *)
  • PARI
    s=[]; for (n=0, 151, v=n-fromdigits(Vecrev(binary(n)),2); if (!setsearch(s,v), print1 (v ", "); s=setunion(s, [v])))

A265326 n-th prime minus its binary reversal.

Original entry on oeis.org

1, 0, 0, 0, -2, 2, 0, -6, -6, 6, 0, -4, 4, -10, -14, 10, 4, 14, -30, -42, 0, -42, -18, 12, 30, 18, -12, 0, 18, 42, 0, -62, -8, -70, -20, -82, -28, -34, -62, -8, -26, 8, -62, 62, 34, -28, 8, -28, 28, 62, 82, -8, 98, 28, 0, -186, -84, -210, -60
Offset: 1

Views

Author

Max Barrentine, Dec 07 2015

Keywords

Comments

a(n) = 0 iff A000040(n) is in A016041. - Altug Alkan, Dec 07 2015
The graph consists of a succession of parallelograms. The parallelograms end when there is a long run of mostly positive terms followed by a long run of mostly negative terms. The places where the successive parallelograms end are the primes just before a power of 2: 3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, ..., which are terms with indices 2, 4, 6, 11, 18, 31, 54, 97, 172, 309, 564, 1028, 1900, 3512, 6542, 12251, 23000, 43390, 82025, ... (see A014234 and A007053). - N. J. A. Sloane, May 29 2016

Examples

			n=5: prime(5) = 11_10 = 1011_2, reversing gives 1101_2 = 13_10, so a(5) = 11-13 = -2.
		

Crossrefs

Programs

  • Maple
    revdigs:= proc(n) local L, j;
      L:= convert(n,base,2);
      add(L[-j]*2^(j-1),j=1..nops(L))
    end proc:
    map(t -> t - revdigs(t),  select(isprime, [2,seq(i,i=3..1000,2)])); # Robert Israel, Dec 08 2015
  • Mathematica
    Table[# - FromDigits[Reverse@ IntegerDigits[#, 2], 2] &@ Prime@ n, {n, 60}] (* Michael De Vlieger, Dec 09 2015 *)
  • PARI
    a098957(n) = my(v=binary(prime(n)), s); forstep(i=#v, 1, -1, s+=s+v[i]); s
    a(n) = prime(n) - a098957(n); \\ Altug Alkan, Dec 07 2015

Formula

a(n) = A000040(n) - A098957(n).
a(n) = A055945(A000040(n)). - Michel Marcus, Dec 08 2015

A259656 Let f(x) be the absolute value of the difference between x and its base-2 reversal. a(n) is the number of times f(x) must be applied starting with n for the result to be 0.

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 4, 3, 2, 3, 4, 3, 4, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 3, 2, 1, 2, 3, 2, 3, 2, 3, 4, 3, 2, 3
Offset: 1

Views

Author

Dylan Hamilton, Jul 02 2015

Keywords

Comments

First differences appear to always be odd.
More precisely, a(n) is even if n is even and a(n) is odd when n is odd. This is an immediate consequence of the parities in A055945 (which represents f apart from the sign) and the fact that we count iterations of f until the result is even. - Jörgen Backelin, Nov 04 2015

Crossrefs

Cf. A055945.

Programs

  • Maple
    A259656 := proc(n)
        local f,a ;
        f := n ;
        a := 0 ;
        while f <> 0 do
            f := abs(A055945(f)) ;
            a := a+1 ;
        end do:
        a;
    end proc: # R. J. Mathar, Nov 04 2015

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).

A259658 Let f(x) be the absolute value of the difference between x and its base-2 reversal. Let g(x) be the number of times f(x) must be applied to x for the result to be 0. a(n) is the smallest value of x for which g(x) is n.

Original entry on oeis.org

0, 1, 2, 11, 38, 271, 544, 2093, 2624, 8607, 17984, 35343, 35904, 70671, 71744, 141327, 143424, 282639, 286784, 565263, 573504, 1130511, 1146944, 2261007, 2293824, 4521999, 4587584, 9043983, 9175104, 18087951, 18350144, 36175887, 36700224, 72351759, 73400384
Offset: 0

Views

Author

Dylan Hamilton, Jul 02 2015

Keywords

Comments

f(x) = abs(A055945(x)).

Crossrefs

Programs

  • Magma
    I:=[0,1,2,11,38,271,544,2093,2624, 8607,17984,35343, 35904,70671]; [n le 14 select I[n] else 3*Self(n-2)-2*Self(n-4): n in [1..50]]; // Vincenzo Librandi, Jul 10 2015
  • Mathematica
    CoefficientList[Series[x (18144 x^12 + 12800 x^11 - 13708 x^10 -11200 x^9 - 2870 x^8 - 1068 x^7 - 1302 x^6 - 434 x^5 - 240 x^4 - 32 x^3 - 8 x^2 - 2 x - 1)/((1 - x) (x + 1) (2 x^2 - 1)), {x, 0, 50}], x] (* Vincenzo Librandi, Jul 10 2015 *)
    LinearRecurrence[{0,3,0,-2},{0,1,2,11,38,271,544,2093,2624,8607,17984,35343,35904,70671},50] (* Harvey P. Dale, Nov 23 2022 *)

Formula

G.f.: -x*(18144*x^12 +12800*x^11 -13708*x^10 -11200*x^9 -2870*x^8 -1068*x^7 -1302*x^6 -434*x^5 -240*x^4 -32*x^3 -8*x^2 -2*x-1)/ ((x-1) *(x+1) *(2*x^2-1)). - Alois P. Heinz, Jul 02 2015

Extensions

a(0), a(19)-a(34) from Alois P. Heinz, Jul 02 2015
Showing 1-5 of 5 results.