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

A284566 Odd bisection of A284556.

Original entry on oeis.org

0, 1, 2, 1, 2, 3, 2, 2, 3, 3, 4, 4, 3, 4, 4, 2, 3, 5, 5, 5, 6, 6, 6, 5, 4, 6, 7, 5, 5, 6, 4, 3, 4, 5, 7, 7, 7, 9, 9, 6, 7, 10, 10, 9, 9, 9, 8, 6, 5, 8, 10, 8, 9, 11, 9, 7, 7, 8, 9, 8, 6, 7, 6, 3, 4, 7, 8, 8, 10, 11, 11, 9, 9, 13, 15, 12, 12, 14, 11, 8, 9, 12, 15, 14, 14, 17, 16, 11, 11, 15, 15, 13, 12, 12, 10, 7, 6
Offset: 0

Views

Author

Antti Karttunen, Apr 05 2017

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Which[n < 2, n, EvenQ@ n, a[n/2], True, a[(n - 1)/2] + a[(n + 1)/2]]; Table[(a[#] - JacobiSymbol[#, 3])/2 &[2 n + 1], {n, 0, 96}] (* Michael De Vlieger, Apr 05 2017 *)
  • Scheme
    (define (A284566 n) (A284556 (+ n n 1)))
    (define (A284566 n) (A001222 (A284564 n)))

Formula

a(n) = A284556((2*n)+1).
a(n) = A001222(A284564(n)).
Other identities. For all n >= 1:
A007306(n) = a(n-1) + A284565(n-1).

A000360 Distribution of nonempty triangles inside a fractal rep-4-tile.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 2, 0, 2, 2, 2, 1, 3, 1, 2, 1, 2, 2, 4, 1, 4, 3, 3, 1, 4, 2, 4, 2, 3, 2, 3, 0, 3, 3, 4, 2, 6, 3, 5, 2, 5, 4, 7, 2, 6, 4, 4, 1, 5, 3, 6, 3, 6, 4, 6, 1, 5, 4, 5, 2, 5, 2, 3, 1, 3, 3, 6, 2, 7, 5, 6, 2, 8, 5, 9, 4, 8, 5, 7, 1, 7, 6, 9, 4, 11, 6, 9, 3, 8, 6, 10, 3, 8, 5, 5, 1, 6, 4, 8, 4, 9, 6, 9, 2
Offset: 0

Views

Author

Keywords

Comments

a(n) = Running count of congruent nonempty triangles along lines perpendicular to the base of the Gosper-Lafitte triangle.
Also, a(n) = Sum of the coefficients of the terms with an even exponent in the Stern polynomial B(n+1,t), or in other words, the sum of the even-indexed terms (the leftmost is at index 0) of the irregular triangle A125184, starting from its second row. - Antti Karttunen, Apr 20 2017
Back in May 1995, it was proved that a(n) = modulo 3 mapping, (+1,-1,+0)/2, of the Stern-Brocot sequence A002487, dropping its 1st term. - M. Jeremie Lafitte (Levitas), Apr 23 2017

References

  • M. J. Lafitte, Sur l'Effet Noah en Géométrie, rapport à l'INPI, mars 1995.

Crossrefs

Cf. also mutual recurrence pair A287729, A287730.

Programs

  • Haskell
    import Data.List (transpose)
    a000360 n = a000360_list !! n
    a000360_list = 1 : concat (transpose
       [zipWith (+) a000360_list $ drop 2 a057078_list,
        zipWith (+) a000360_list $ tail a000360_list])
    -- Reinhard Zumkeller, Mar 22 2013
    (Scheme, with memoization-macro definec):
    (define (A000360 n) (A000360with_prep_0 (+ 1 n)))
    (definec (A000360with_prep_0 n) (cond ((<= n 1) n) ((even? n) (A284556 (/ n 2))) (else (+ (A000360with_prep_0 (/ (- n 1) 2)) (A000360with_prep_0 (/ (+ n 1) 2))))))
    (definec (A284556 n) (cond ((<= n 1) 0) ((even? n) (A000360with_prep_0 (/ n 2))) (else (+ (A284556 (/ (- n 1) 2)) (A284556 (/ (+ n 1) 2))))))
    ;; Antti Karttunen, Apr 07 2017
    
  • Mathematica
    a[0] = 1; a[n_?EvenQ] := a[n] = a[n/2] + a[n/2-1]; a[n_?OddQ] := a[n] = a[(n-1)/2] - Mod[(n-1)/2-1, 3] + 1; Table[a[n], {n, 0, 103}] (* Jean-François Alcover, Jan 20 2015, after Ralf Stephan *)
  • PARI
    a(n) = if(n==0, 1, if(n%2, a((n - 1)/2) - ((n - 1)/2 - 1)%3 + 1, a(n/2) + a(n/2 - 1))); \\ Indranil Ghosh, Apr 20 2017

Formula

a(3n) = (A002487(3n+1) + 1)/2, a(3n+1) = (A002487(3n+2) - 1)/2, a(3n+2) = A002487(3n+3)/2. - M. Jeremie Lafitte (Levitas), Apr 23 2017
a(0) = 1, a(2n) = a(n) + a(n-1), a(2n+1) = a(n) + 1 - (n-1 mod 3). - Ralf Stephan, Oct 05 2003; Note: according to Ralf Stephan, this formula was found empirically. It follows from that found for the Stern-Brocot sequence A002487 and the first formula. - Antti Karttunen, Apr 21 2017, M. Jeremie Lafitte (Levitas), Apr 23 2017
From Antti Karttunen, Apr 07 2017: (Start)
Ultimately equivalent to the above formulae, we have:
a(n) = A001222(A284553(1+n)).
a(n) = A002487(1+n) - A284556(1+n).
a(n) = b(1+n), with b from a mutual recurrence pair: b(0) = 0, b(1) = 1, b(2n) = c(n), b(2n+1) = b(n) + b(n+1), c(0) = c(1) = 0, c(2n) = b(n), c(2n+1) = c(n) + c(n+1). [c(n) = A284556(n), b(n)+c(n) = A002487(n).]
(End)

Extensions

More terms from David W. Wilson, Aug 30 2000
Original relation to the Stern-Brocot sequence A002487 reformulated by M. Jeremie Lafitte (Levitas), Apr 23 2017

A287729 The c-fusc function c(n) = a(n): a(1)=1, a(2n) = s(n), a(2n+1) = s(n)+s(n+1), where s(n) = A287730(n).

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 3, 2, 3, 1, 2, 1, 1, 0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 6, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 2, 9, 7, 12, 5, 13, 8, 11, 3, 10, 7, 11, 4, 9, 5, 6, 1, 5, 4, 7, 3
Offset: 1

Views

Author

I. V. Serov, May 30 2017

Keywords

Comments

Define a sequence chf(n) of Christoffel words over an alphabet {-,+}:
chf(1) = '-',
chf(2*n+0) = negate(chf(n)),
chf(2*n+1) = negate(concatenate(chf(n),chf(n+1))).
Then the length of the chf(n) word is fusc(n) = A002487(n), the number of '-'-signs in the chf(n) word is c-fusc(n) = a(n) (the current sequence) and the number of '+'-signs in the chf(n) word is s-fusc(n) = A287730(n). See examples below.

Examples

			A000027(n) chf(n) A070939(n) A002487(n)    a(n)    A287730(n)
                                fusc       c-fusc     s-fusc
01         '-'       1          1          1          0
02         '+'       2          1          0          1
03         '+-'      2          2          1          1
04         '-'       3          1          1          0
05         '--+'     3          3          2          1
06         '-+'      3          2          1          1
07         '-++'     3          3          1          2
08         '+'       4          1          0          1
09         '+++-'    4          4          1          3
10         '++-'     4          3          1          2
11         '++-+-'   4          5          2          3
12         '+-'      4          2          1          1
13         '+-+--'   4          5          3          2
14         '+--'     4          3          2          1
15         '+---'    4          4          3          1
16         '-'       5          1          1          0
17         '----+'   5          5          4          1
		

Crossrefs

Cf. mutual recurrence pair A000360, A284556 and also A213369.

Programs

  • Python
    from sympy.core.cache import cacheit
    @cacheit
    def c(n): return 1 if n==1 else s(n//2) if n%2==0 else s((n - 1)//2) + s((n + 1)//2)
    @cacheit
    def s(n): return 0 if n==1 else c(n//2) if n%2==0 else c((n - 1)//2) + c((n + 1)//2)
    print([c(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 08 2017
  • Scheme
    (definec (A287729 n) (cond ((= 1 n) n) ((even? n) (A287730 (/ n 2))) (else (+ (A287730 (/ (- n 1) 2)) (A287730 (/ (+ n 1) 2))))))
    ;; An implementation of memoization-macro definec can be found for example in: http://oeis.org/wiki/Memoization - Antti Karttunen, Jun 01 2017
    

Formula

The mutual diatomic recurrence pair c(n) (this sequence) and s(n) (A287730) are defined by c(1)=1, s(1)=0, c(2n) = s(n), c(2n+1) = s(n)+s(n+1), s(2n) = c(n), s(2n+1) = c(n)+c(n+1).
a(n) + A287730(n) = A002487(n). [c-fusc(n) + s-fusc(n) = fusc(n).]
gcd(a(n), A287730(n)) = gcd(a(n), A002487(n)) = 1.
Let k(n) = A037227(n) = 1 + 2*A007814(n) = 1 + 2*floor(A002487(n-1)/A002487(n)) for n > 1.
Let d(n) = 2*A255738(n)*(-1)^A070939(n) = 2*(n==2^(A070939(n)-1)+1)*(-1)^A070939(n) = 2*(n==A053644(n)+1)*(-1)^A070939(n) = 2*(A002487(n-1)==1)*(-1)^A070939(n) for n > 1;
then a(n) = k(n-1)*a(n-1) - a(n-2) + d(n) for n > 2 with a(1) = 1, a(2) = 0.
From Yosu Yurramendi, Apr 09 2019: (Start)
For m >= 0, m even, 0 <= k < 2^m, a(2^m+k) = A002487(2^m-k).
For m >= 0, m odd, 0 <= k < 2^m, a(2^m+k) = A002487(k).
(End)

A287730 The s-fusc function s(n) = a(n): a(1) = 0, a(2n) = A287729(n), a(2n+1) = A287729(n) + A287729(n+1).

Original entry on oeis.org

0, 1, 1, 0, 1, 1, 2, 1, 3, 2, 3, 1, 2, 1, 1, 0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 4, 3, 5, 2, 5, 3, 4, 1, 3, 2, 3, 1, 2, 1, 1, 0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 6, 5, 9, 4
Offset: 1

Views

Author

I. V. Serov, May 30 2017

Keywords

Comments

Define a sequence chf(n) of Christoffel words over an alphabet {-,+}:
chf(1) = '-',
chf(2*n+0) = negate(chf(n)),
chf(2*n+1) = negate(concatenate(chf(n),chf(n+1))).
Then the length of the chf(n) word is fusc(n) = A002487(n), the number of '-'-signs in the chf(n) word is c-fusc(n) = A287729(n) and the number of '+'-signs in the chf(n) word is the current sequence a(n) = s-fusc(n). See examples below.

Examples

			n         chf(n) A070939(n) A002487(n) A287729(n)    a(n)
                                fusc       c-fusc     s-fusc
1          '-'       1          1          1          0
2          '+'       2          1          0          1
3          '+-'      2          2          1          1
4          '-'       3          1          1          0
5          '--+'     3          3          2          1
6          '-+'      3          2          1          1
7          '-++'     3          3          1          2
8          '+'       4          1          0          1
9          '+++-'    4          4          1          3
10         '++-'     4          3          1          2
11         '++-+-'   4          5          2          3
12         '+-'      4          2          1          1
13         '+-+--'   4          5          3          2
14         '+--'     4          3          2          1
15         '+---'    4          4          3          1
16         '-'       5          1          1          0
17         '----+'   5          5          4          1
		

Crossrefs

Cf. mutual recurrence pair A000360, A284556 and also A213369.

Programs

  • Python
    from sympy.core.cache import cacheit
    @cacheit
    def c(n): return 1 if n==1 else s(n//2) if n%2==0 else s((n - 1)//2) + s((n + 1)//2)
    @cacheit
    def s(n): return 0 if n==1 else c(n//2) if n%2==0 else c((n - 1)//2) + c((n + 1)//2)
    print([s(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 08 2017
  • Scheme
    (definec (A287730 n) (cond ((= 1 n) 0) ((even? n) (A287729 (/ n 2))) (else (+ (A287729 (/ (- n 1) 2)) (A287729 (/ (+ n 1) 2))))))
    ;; An implementation of memoization-macro definec can be found for example in: http://oeis.org/wiki/Memoization
    ;; Second version after the alternative formula given by the author:
    (definec (A287730 n) (if (<= n 2) (- n 1) (- (* (A037227 (- n 1)) (A287730 (- n 1))) (A287730 (- n 2)) (* (if (= 1 (A002487 (- n 1))) 1 0) 2 (expt -1 (A070939 n)))))) ;; Antti Karttunen, Jun 01 2017
    

Formula

The mutual diatomic recurrence pair c(n) (A287729) and s(n) (this sequence) are defined by c(1)=1, s(1)=0, c(2n) = s(n), c(2n+1) = s(n)+s(n+1), s(2n) = c(n), s(2n+1) = c(n)+c(n+1).
a(n) + A287729(n) = A002487(n). [s-fusc(n) + c-fusc(n) = fusc(n).]
gcd(a(n), A287729(n)) = gcd(a(n), A002487(n)) = 1.
Let k(n) = A037227(n) = 1 + 2*A007814(n) = 1 + 2*floor(A002487(n-1)/A002487(n)) for n > 1.
Let d(n) = 2*A255738(n)*(-1)^A070939(n) = 2*(n==2^(A070939(n)-1)+1)*(-1)^A070939(n) = 2*(n==A053644(n)+1)*(-1)^A070939(n) = 2*(A002487(n-1)==1)*(-1)^A070939(n) for n > 1;
then a(n) = k(n-1)*a(n-1) - a(n-2) - d(n) for n > 2 with a(1) = 0, a(2) = 1.

A284565 Bisection of A000360.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 2, 2, 4, 4, 3, 4, 4, 3, 3, 3, 4, 6, 5, 5, 7, 6, 4, 5, 6, 6, 6, 5, 5, 5, 3, 3, 6, 7, 6, 8, 9, 8, 7, 7, 9, 11, 9, 8, 10, 8, 5, 6, 8, 9, 9, 9, 10, 10, 7, 6, 9, 9, 7, 7, 7, 5, 4, 4, 6, 9, 8, 9, 12, 11, 8, 10, 13, 14, 13, 12, 13, 12, 8, 8, 13, 15, 13, 15, 17, 15, 12, 11, 14, 16, 13, 11, 13, 10, 6, 7, 10
Offset: 0

Views

Author

Antti Karttunen, Apr 05 2017

Keywords

Crossrefs

Programs

Formula

a(n) = A000360(2n).
a(n) = A001222(A284563(n)).
Other identities. For all n >= 1:
A007306(n) = a(n-1) + A284566(n-1).

A284553 Prime factorization representation of Stern polynomials B(n,x) with only the even powers of x present: a(n) = A247503(A260443(n)).

Original entry on oeis.org

1, 2, 1, 2, 5, 2, 5, 10, 1, 10, 25, 10, 5, 50, 5, 10, 11, 10, 25, 250, 5, 250, 125, 50, 11, 250, 25, 250, 55, 50, 55, 110, 1, 110, 275, 250, 55, 6250, 125, 1250, 121, 1250, 625, 31250, 55, 6250, 1375, 550, 11, 2750, 275, 6250, 605, 6250, 1375, 13750, 11, 2750, 3025, 2750, 55, 6050, 55, 110, 17, 110, 275, 30250, 55, 68750, 15125, 13750, 121
Offset: 0

Views

Author

Antti Karttunen, Mar 29 2017

Keywords

Comments

a(n) = Prime factorization representation of Stern polynomials B(n,x) where the coefficients of odd powers of x are replaced by zeros. In other words, only the constant term and other terms with even powers of x are present. See the examples.
Proof that A001222(a(1+n)) matches Ralf Stephan's formula for A000360(n): Consider functions A001222(a(n)) and A001222(A284554(n)) (= A284556(n)). They can be reduced to the following mutual recurrence pair: b(0) = 0, b(1) = 1, b(2n) = c(n), b(2n+1) = b(n) + b(n+1) and c(0) = c(1) = 0, c(2n) = b(n), c(2n+1) = c(n) + c(n+1). From the definitions it follows that the difference b(n) - c(n) for even n is b(2n) - c(2n) = -(b(n) - c(n)), and for odd n, b(2n+1) - c(2n+1) = (b(n)+b(n+1))-(c(n)+c(n+1)) = (b(n)-c(n)) + (b(n+1)-c(n+1)). Then by induction, if we assume that for 3n, 3n+1, 3n+2, ..., 6n, the value of difference b(n)-c(n) is always [0, +1, -1; repeated], it follows that from 6n to 12n the differences are [0, +1, -1; 0, +1, -1; repeated], which proves that b(n) - c(n) = A102283(n). As an implication, recurrence b can be defined without referring to c as: b(0) = 0, b(1) = 1, b(2n) = b(n) - A102283(n), b(2n+1) = b(n)+b(n+1), and this is equal to Ralf Stephan's Oct 05 2003 formula for A000360, but shifted once right, with prepended zero.

Examples

			n A260443(n)                      Stern            With odd powers
             prime factorization  polynomial       of x cleared  -> a(n)
------------------------------------------------------------------------
0       1    (empty)              B_0(x) = 0                    0  |  1
1       2    p_1                  B_1(x) = 1                    1  |  2
2       3    p_2                  B_2(x) = x                    0  |  1
3       6    p_2 * p_1            B_3(x) = x + 1                1  |  2
4       5    p_3                  B_4(x) = x^2                x^2  |  5
5      18    p_2^2 * p_1          B_5(x) = 2x + 1               1  |  2
6      15    p_3 * p_2            B_6(x) = x^2 + x            x^2  |  5
7      30    p_3 * p_2 * p_1      B_7(x) = x^2 + x + 1    x^2 + 1  | 10
8       7    p_4                  B_8(x) = x^3                  0  |  1
9      90    p_3 * p_2^2 * p_1    B_9(x) = x^2 + 2x + 1   x^2 + 1  | 10
10     75    p_3^2 * p_2          B_10(x) = 2x^2 + x         2x^2  | 25
		

Crossrefs

Programs

Formula

a(0) = 1, a(1) = 2, a(2n) = A003961(A284554(n)), a(2n+1) = a(n)*a(n+1).
Other identities. For all n >= 0:
a(n) = A247503(A260443(n)).
a(n) = A260443(n) / A284554(n).
a(n) = A064989(A284554(2n)).
A001222(a(1+n)) = A000360(n). [Proof in Comments section.]

A284554 Prime factorization representation of Stern polynomials B(n,x) with only the odd powers of x present: a(n) = A248101(A260443(n)).

Original entry on oeis.org

1, 1, 3, 3, 1, 9, 3, 3, 7, 9, 3, 27, 7, 9, 21, 21, 1, 63, 21, 27, 49, 81, 21, 189, 7, 63, 147, 189, 7, 441, 21, 21, 13, 63, 21, 1323, 49, 567, 1029, 1323, 7, 3969, 1029, 1701, 343, 3969, 147, 1323, 13, 441, 1029, 9261, 49, 27783, 1029, 1323, 91, 3087, 147, 9261, 91, 441, 273, 273, 1, 819, 273, 1323, 637, 27783, 1029, 64827, 91, 27783, 50421, 583443, 343
Offset: 0

Views

Author

Antti Karttunen, Mar 29 2017

Keywords

Comments

a(n) = Prime factorization representation of Stern polynomials B(n,x) where the coefficients of even powers of x (including the constant term) are replaced by zeros. In other words, only the terms with odd powers of x are present. See the examples.

Examples

			n A260443(n)                      Stern            With even powers
             prime factorization  polynomial       of x cleared  -> a(n)
------------------------------------------------------------------------
0       1    (empty)              B_0(x) = 0                    0  |  1
1       2    p_1                  B_1(x) = 1                    0  |  1
2       3    p_2                  B_2(x) = x                    x  |  3
3       6    p_2 * p_1            B_3(x) = x + 1                x  |  3
4       5    p_3                  B_4(x) = x^2                  0  |  1
5      18    p_2^2 * p_1          B_5(x) = 2x + 1              2x  |  9
6      15    p_3 * p_2            B_6(x) = x^2 + x              x  |  3
7      30    p_3 * p_2 * p_1      B_7(x) = x^2 + x + 1          x  |  3
8       7    p_4                  B_8(x) = x^3                x^3  |  7
9      90    p_3 * p_2^2 * p_1    B_9(x) = x^2 + 2x + 1        2x  |  9
10     75    p_3^2 * p_2          B_10(x) = 2x^2 + x            x  |  3
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = Which[n < 2, n + 1, EvenQ@ n, Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[# == 1] &@ a[n/2], True, a[#] a[# + 1] &[(n - 1)/2]]; Table[Times @@ (FactorInteger[#] /. {p_, e_} /; e > 0 :> (p^Mod[PrimePi@ p + 1, 2])^e) &@ a@ n, {n, 0, 76}] (* Michael De Vlieger, Apr 05 2017 *)
  • PARI
    A003961(n) = { my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); }; \\ From Michel Marcus
    A260443(n) = if(n<2, n+1, if(n%2, A260443(n\2)*A260443(n\2+1), A003961(A260443(n\2)))); \\ Cf. Charles R Greathouse IV's code for "ps" in A186891 and A277013.
    A248101(n) = { my(f = factor(n)); for (i=1, #f~, f[i, 2] *= (primepi(f[i, 1])+1) % 2; ); factorback(f); } \\ After Michel Marcus
    A284554(n) = A248101(A260443(n));
    
  • Scheme
    (define (A284554 n) (A248101 (A260443 n)))

Formula

a(0) = a(1) = 1, a(2n) = A003961(A284553(n)), a(2n+1) = a(n)*a(n+1).
Other identities. For all n >= 0:
a(n) = A248101(A260443(n)).
a(n) = A260443(n) / A284553(n).
a(n) = A064989(A284553(2n)).
A001222(a(n)) = A284556(n).
Showing 1-7 of 7 results.