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

A140266 Inverse permutation to A140265.

Original entry on oeis.org

1, 2, 3, 6, 8, 4, 7, 5, 9, 18, 20, 16, 24, 26, 22, 12, 14, 10, 19, 17, 21, 13, 11, 15, 25, 23, 27, 54, 56, 52, 60, 62, 58, 48, 50, 46, 72, 74, 70, 78, 80, 76, 66, 68, 64, 36, 38, 34, 42, 44, 40, 30, 32, 28, 55, 53, 57, 49, 47, 51, 61, 59, 63, 37, 35, 39, 31, 29, 33, 43, 41, 45
Offset: 1

Views

Author

Antti Karttunen, May 19 2008

Keywords

Crossrefs

Inverse: A140265. a(n) = A140264(n-1)+1.

Programs

  • Python
    def a117966(n):
        if n==0: return 0
        if n%3==0: return 3*a117966(n/3)
        elif n%3==1: return 3*a117966((n - 1)/3) + 1
        else: return 3*a117966((n - 2)/3) - 1
    def Z(z): return 2*z if z>0 else 2*abs(z) + 1
    def a(n): return Z(a117966(n - 1)) # Indranil Ghosh, Jun 07 2017
  • Scheme
    (string-append (define (A140266 n) (Z->N (A117966 (- n 1))))
    (define (Z->N n) (if (positive? n) (* n 2) (+ 1 (* 2 (- n))))))
    

Formula

a(n) = Z->N(A117966(n-1)), where Z->N(z) = 2z if z>0 else 2|z|+1.

A140263 Permutation of nonnegative integers obtained by interleaving A117967 and A117968.

Original entry on oeis.org

0, 1, 2, 5, 7, 3, 6, 4, 8, 17, 22, 15, 21, 16, 23, 11, 19, 9, 18, 10, 20, 14, 25, 12, 24, 13, 26, 53, 67, 51, 66, 52, 68, 47, 64, 45, 63, 46, 65, 50, 70, 48, 69, 49, 71, 35, 58, 33, 57, 34, 59, 29, 55, 27, 54, 28, 56, 32, 61, 30, 60, 31, 62, 44, 76, 42, 75, 43, 77, 38, 73, 36
Offset: 0

Views

Author

Antti Karttunen, May 19 2008, originally described in a posting at the SeqFan mailing list on Sep 15 2005

Keywords

Crossrefs

Inverse: A140264. Bisections: A117967 & A117968. a(n) = A140265(n+1)-1.

Programs

  • Python
    from sympy import ceiling
    from sympy.ntheory.factor_ import digits
    def a004488(n): return int("".join([str((3 - i)%3) for i in digits(n, 3)[1:]]), 3)
    def a117968(n):
        if n==1: return 2
        if n%3==0: return 3*a117968(n/3)
        elif n%3==1: return 3*a117968((n - 1)/3) + 2
        else: return 3*a117968((n + 1)/3) + 1
    def a117967(n): return 0 if n==0 else a117968(-n) if n<0 else a004488(a117968(n))
    def a001057(n): return -(-1)**n*ceiling(n/2)
    def a(n): return a117967(a001057(n)) # Indranil Ghosh, Jun 07 2017

Formula

a(n) = A117967(A001057(n)). (Assuming that the domain of A117967 is the whole Z line.)

A319390 a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5), a(0)=1, a(1)=2, a(2)=3, a(3)=6, a(4)=8.

Original entry on oeis.org

1, 2, 3, 6, 8, 13, 16, 23, 27, 36, 41, 52, 58, 71, 78, 93, 101, 118, 127, 146, 156, 177, 188, 211, 223, 248, 261, 288, 302, 331, 346, 377, 393, 426, 443, 478, 496, 533, 552, 591, 611, 652, 673, 716, 738, 783, 806, 853, 877, 926, 951, 1002
Offset: 0

Views

Author

Paul Curtz, Sep 18 2018

Keywords

Comments

The bisections A104249(n) = 1, 3, 8, ... and A143689(n+1) = 2, 6, 13, 23, ... are in the following hexagonal spiral:
29--28--28--27--27
/ \
29 17--17--16--16 26
/ / \ \
30 18 9---8---8 15 26
/ / / \ \ \
30 18 9 3---3 7 15 25
/ / / / \ \ \ \
31 19 10 4 1 2 7 14 25
/ / / / / / / /
19 10 4 1---2 6 14 24
\ \ \ / / /
20 11 5---5---6 13 24
\ \ / /
20 11--12--12--13 23
\ /
21--21--22--22--23
.
a(n) mod 9 = A140265(n) mod 9.

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1,2,-2,-1,1},{1,2,3,6,8},100] (* Paolo Xausa, Nov 13 2023 *)
  • PARI
    Vec((1 + x - x^2 + x^3 + x^4) / ((1 - x)^3*(1 + x)^2) + O(x^50)) \\ Colin Barker, Jun 05 2019

Formula

a(2n) = (3*n^2 + n + 2)/2. a(2n+1) = (3*n^2 + 5*n + 4)/2.
a(-n) = a(n).
a(n) = a(n-1) + A026741(n).
G.f.: (1 + x - x^2 + x^3 + x^4) / ((1 - x)^3*(1 + x)^2). - Colin Barker, Jun 05 2019
a(n) = 1 + A001318(n). - Peter Bala, Feb 04 2021
E.g.f.: ((8 + 7*x + 3*x^2)*cosh(x) + (9 + 5*x + 3*x^2)*sinh(x))/8. - Stefano Spezia, Feb 05 2021
Showing 1-3 of 3 results.