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

A094115 Partial sums of A093347.

Original entry on oeis.org

0, 1, 1, 4, 6, 9, 9, 10, 10, 19, 27, 36, 42, 49, 55, 64, 72, 81, 81, 82, 82, 85, 87, 90, 90, 91, 91, 118, 144, 171, 195, 220, 244, 271, 297, 324, 342, 361, 379, 400, 420, 441, 459, 478, 496, 523, 549, 576, 600, 625, 649, 676, 702, 729, 729, 730, 730, 733, 735, 738, 738
Offset: 1

Views

Author

Benoit Cloitre, May 03 2004

Keywords

Programs

  • PARI
    a(n)=sum(k=1,n,-sum(i=1,k-1,(-1)^i*3^valuation(i,3)))

Formula

a(3^k)=(9^k-1)/8

A105774 A "fractal" transform of the Fibonacci numbers: a(1)=1; then if F(n) < k <= F(n+1), a(k) = F(n+1) - a(k - F(n)) where F(n) = A000045(n).

Original entry on oeis.org

1, 1, 2, 4, 4, 7, 7, 6, 12, 12, 11, 9, 9, 20, 20, 19, 17, 17, 14, 14, 15, 33, 33, 32, 30, 30, 27, 27, 28, 22, 22, 23, 25, 25, 54, 54, 53, 51, 51, 48, 48, 49, 43, 43, 44, 46, 46, 35, 35, 36, 38, 38, 41, 41, 40, 88, 88, 87, 85, 85, 82, 82, 83, 77, 77, 78, 80, 80, 69, 69, 70, 72, 72
Offset: 1

Views

Author

Benoit Cloitre, May 04 2005

Keywords

Comments

Let tau = (1+sqrt(5))/2; then the missing numbers 3,5,8,10,13,16,18,21,... are given by round(tau^2*k) for k > 0 (A004937).
Indices n such that a(n) = a(n+1) are given by floor(tau^2*k) - 1 for k > 0 (A003622).
Numbers n such that a(n) differs from a(n+1) are given by floor(tau*k+1/tau) for k > 0 (A022342).
Indices n giving isolated terms (a(n) differs from a(n-1) and a(n+1)) are given by floor(tau*floor(tau^2*k)) for k > 0 (A003623).
Remove 0's from the first differences of sorted values; then you get a version of the infinite Fibonacci word (A001468). I.e., sorted values are 1,1,2,4,4,6,7,7,9,9,11,12,12,..., first differences are 0,1,2,0,2,1,0,2,0,2,1,0,2,0,1,...; removing 0's gives 1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,... #{ k : a(k)=k}=infty.

Examples

			For 1 = F(2) < k <= F(3) = 2 the rule gives a(2) = 2 - a(1) = 1 ... if 5 = F(5) < k <= F(6) = 8 the rule forces a(6) = 8 - a(6-5) = 8 - a(1) = 7; a(7) = 8 - a(2) = 7; a(8) = 8 - a(3) = 6.
		

Crossrefs

Formula

a(A000045(n)) = A006498(n-1) for n >= 1. - Typo corrected by Antti Karttunen, Mar 17 2017
limsup a(n)/n = tau and liminf a(n)/n = (tau+2)/5 where tau = (1+sqrt(5))/2. - Corrected by Jeffrey Shallit, Dec 17 2023
a(n) mod 2 = A085002(n) - Benoit Cloitre, May 10 2005
a(1) = 1; for n > 1, a(n) = A000045(2+A072649(n-1)) - a(n-A000045(1 + A072649(n-1))). - Antti Karttunen, Mar 17 2017

A093348 A 5-fractal "castle" starting with 0.

Original entry on oeis.org

0, 1, 0, 1, 0, 5, 4, 5, 4, 5, 0, 1, 0, 1, 0, 5, 4, 5, 4, 5, 0, 1, 0, 1, 0, 25, 24, 25, 24, 25, 20, 21, 20, 21, 20, 25, 24, 25, 24, 25, 20, 21, 20, 21, 20, 25, 24, 25, 24, 25, 0, 1, 0, 1, 0, 5, 4, 5, 4, 5, 0, 1, 0, 1, 0, 5, 4, 5, 4, 5, 0, 1, 0, 1, 0, 25, 24, 25, 24, 25, 20, 21, 20, 21, 20, 25, 24
Offset: 1

Views

Author

Benoit Cloitre, Apr 26 2004

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[(-1)^(i+1) * 5^IntegerExponent[i, 5], {i, 1, n-1}]; Array[a, 100] (* Amiram Eldar, Jun 17 2022 *)
  • PARI
    a(n)=if(n<2,0,5^floor(log(n-1)/log(5))-a(n-5^floor(log(n-1)/log(5))))

Formula

a(1) = 0, then a(n) = w(n) - a(n-w(n)) where w(n) = 5^floor(log(n-1)/log(5)).
a(n) = Sum_{i=1..n-1} (-1)^(i-1)*5^valuation(i, 5).
Conjecture: a(n+1) = (n mod 2) + Sum_{k=0..infinity} (4*5^k*(floor(n/5^(k+1)) mod 2)). - Charlie Neder, May 25 2019

A105669 A "fractal" transform of the Fibonacci numbers F(n)=A000045(n): a(1)=1, then for n>1 if F(n) < k < F(n+1) we have a(k) = F(n+1)-a(k-F(n)) and when k = F(n+1) we force a(F(n+1)) = F(n+1) + (1+(-1)^n)*F(n).

Original entry on oeis.org

1, 2, 2, 4, 7, 7, 6, 6, 12, 11, 11, 9, 20, 20, 19, 19, 17, 14, 14, 15, 15, 33, 32, 32, 30, 27, 27, 28, 28, 22, 23, 23, 25, 54, 54, 53, 53, 51, 48, 48, 49, 49, 43, 44, 44, 46, 35, 35, 36, 36, 38, 41, 41, 40, 40, 88, 87, 87, 85, 82, 82, 83, 83, 77, 78, 78, 80, 69, 69, 70, 70, 72
Offset: 1

Views

Author

Benoit Cloitre, May 03 2005

Keywords

Comments

Let b denote the sequence of n such that a(n)=a(n+1), then b(n)=floor(tau^2*n) where tau=(1+sqrt(5))/2.
Missing numbers are the nearest integer to tau^2*n, n>=0 (cf. A004937).
#{k>0 : a(k) = k} = infinity.
This kind of "fractal" transform can be applied to any increasing monotonic sequence giving true fractal properties for sequences = (m^n)_{n>0} with m integer >=2, specially when m is odd (cf. A093347, A093348).

Examples

			For 5 = F(5) < k <= F(6) = 8 we get a(6) = 8-a(6-5) = 8-a(1) = 7.
a(7) = 8-a(7-5) = 8-a(2) = 6.
a(8) = 8-a(8-5) = 8-a(3) = 6.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[n <= 1, 1, Fibonacci[(k = Floor[Log[Sqrt[5]*n]/Log[GoldenRatio]]) + 1] - a[n - Fibonacci[k]]]; Array[a, 100] (* Amiram Eldar, Jun 17 2022 *)
  • PARI
    f=(1+sqrt(5))/2; a(n)=if(n<2,1,fibonacci(floor(log(sqrt(5)*n)/log(f))+1)-a(n-fibonacci(floor(log(sqrt(5)*n)/log(f)))))

Formula

F(2n) = F(2n+1) - F(n+1)^2 + F(n)*F(n-1) for n>0.
a(F(2n-1)) = F(2n)-1 for n>1.
1/tau < a(n)/n < tau.

A105670 a(1)=1 then bracketing n by powers of 2 as f(t)=2^t for f(t) < n <= f(t+1), a(n) = f(t+1) - a(n-f(t)).

Original entry on oeis.org

1, 1, 3, 3, 7, 7, 5, 5, 15, 15, 13, 13, 9, 9, 11, 11, 31, 31, 29, 29, 25, 25, 27, 27, 17, 17, 19, 19, 23, 23, 21, 21, 63, 63, 61, 61, 57, 57, 59, 59, 49, 49, 51, 51, 55, 55, 53, 53, 33, 33, 35, 35, 39, 39, 37, 37, 47, 47, 45, 45, 41, 41, 43, 43, 127, 127, 125, 125, 121, 121, 123
Offset: 1

Views

Author

Benoit Cloitre, May 03 2005

Keywords

Crossrefs

Programs

  • Maple
    A062383 := proc(n)
            ceil(log(n)/log(2)) ;
            2^% ;
    end proc:
    A105670 := proc(n)
            option remember;
            if n = 1 then
                    1;
            else
                    fn1 := A062383(n) ;
                    fn := fn1/2 ;
                    fn1-procname(n-fn) ;
            end if;
    end proc:
    seq(A105670(n),n=1..80) ; # R. J. Mathar, Nov 06 2011
  • Mathematica
    t[0] = 0; t[1] = 1; t[n_?EvenQ] := t[n] = t[n/2]; t[n_?OddQ] := t[n] = 1 - t[(n-1)/2]; a[1] = 1; a[n_?EvenQ] := a[n] = a[n - 1]; a[n_] := a[n] = 2*a[Ceiling[n/2]] - 1 + 2*t[Ceiling[n/2] - 1]; Table[a[n], {n, 1, 71}] (* Jean-François Alcover, Aug 13 2013 *)
  • PARI
    b(n,m)=if(n<2,1,m*m^floor(log(n-1)/log(m))-b(n-m^floor(log(n-1)/log(m)),m))

Formula

a(2n-1) = a(2n).
a(n) = 2*a(ceiling(n/2)) -1 + 2*t(ceiling(n/2)-1) where t(n) = A010060(n) is the Thue-Morse sequence.
a(2n-1) = a(2n) = 2*A006068(n-1)+1. - Jeffrey Shallit, Mar 15 2025

Extensions

Typo in data corrected by Jean-François Alcover, Aug 13 2013

A105672 a(1)=1, then bracketing n with powers of 3 as f(t)=3^t for f(t) < n <= f(t+1), a(n) = f(t+1) - a(n-f(t)).

Original entry on oeis.org

1, 2, 1, 8, 7, 8, 1, 2, 1, 26, 25, 26, 19, 20, 19, 26, 25, 26, 1, 2, 1, 8, 7, 8, 1, 2, 1, 80, 79, 80, 73, 74, 73, 80, 79, 80, 55, 56, 55, 62, 61, 62, 55, 56, 55, 80, 79, 80, 73, 74, 73, 80, 79, 80, 1, 2, 1, 8, 7, 8, 1, 2, 1, 26, 25, 26, 19, 20, 19, 26, 25, 26, 1, 2, 1, 8, 7, 8, 1, 2, 1
Offset: 1

Views

Author

Benoit Cloitre, May 03 2005

Keywords

Crossrefs

Programs

  • Maple
    A105672 := proc(n)
            option remember;
            if n = 1 then
                    1;
            else
                    fn1 := A064235(n) ;
                    fn := fn1/3 ;
                    fn1-procname(n-fn) ;
            end if;
    end proc:
    seq(A105672(n),n=1..80) ; # R. J. Mathar, Nov 06 2011
  • Mathematica
    A064235[n_] := 3^Ceiling[Log[3, n]]; a[1] = 1; a[n_] := a[n] = A064235[n] - a[n - A064235[n]/3]; Table[a[n], {n, 1, 81}] (* Jean-François Alcover, Jul 09 2013, after R. J. Mathar *)
  • PARI
    b(n,m)=if(n<2,1,m*m^floor(log(n-1)/log(m))-b(n-m^floor(log(n-1)/log(m)),m))

Formula

a(n+1) = 1 + Sum_{k=1..n} (-1)^k*(2-3*3^valuation(k, 3)).
a(n) = A064235(n) - a(n - A064235(n)/3). - R. J. Mathar, Nov 06 2011

A093349 A 7-fractal "castle" starting with 0.

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 0, 7, 6, 7, 6, 7, 6, 7, 0, 1, 0, 1, 0, 1, 0, 7, 6, 7, 6, 7, 6, 7, 0, 1, 0, 1, 0, 1, 0, 7, 6, 7, 6, 7, 6, 7, 0, 1, 0, 1, 0, 1, 0, 49, 48, 49, 48, 49, 48, 49, 42, 43, 42, 43, 42, 43, 42, 49, 48, 49, 48, 49, 48, 49, 42, 43, 42, 43, 42, 43, 42, 49, 48, 49, 48, 49, 48, 49, 42, 43
Offset: 1

Views

Author

Benoit Cloitre, Apr 26 2004

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[(-1)^(i+1) * 7^IntegerExponent[i, 7], {i, 1, n-1}]; Array[a, 100] (* Amiram Eldar, Jun 17 2022 *)
  • PARI
    a(n)=if(n<2,0,7^floor(log(n-1)/log(7))-a(n-7^floor(log(n-1)/log(7))))
    
  • PARI
    a(n)=-sum(i=1,n-1,(-1)^i*7^valuation(i,7))

Formula

a(1) = 0 then a(n) = w(n) - a(n-w(n)) where w(n) = 7^floor(log(n-1)/log(7)).
a(n) = Sum_{i=1..n-1} (-1)^(i-1)*7^valuation(i, 7).

A094114 a(n) = -Sum_{i=1..n-1} (-1)^i*2^valuation(i,3).

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, May 03 2004

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> -add((-1)^i*2^padic[ordp](i, 3), i=1..n-1):
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 05 2021
  • Mathematica
    a[n_] := Sum[(-1)^(i+1) * 2^IntegerExponent[i, 3], {i, 1, n-1}]; Array[a, 100] (* Amiram Eldar, Jun 17 2022 *)
  • PARI
    a(n)=-sum(i=1,n-1,(-1)^i*2^valuation(i,3))

A368595 Alternating sum of A006519.

Original entry on oeis.org

-1, 1, 0, 4, 3, 5, 4, 12, 11, 13, 12, 16, 15, 17, 16, 32, 31, 33, 32, 36, 35, 37, 36, 44, 43, 45, 44, 48, 47, 49, 48, 80, 79, 81, 80, 84, 83, 85, 84, 92, 91, 93, 92, 96, 95, 97, 96, 112, 111, 113, 112, 116, 115, 117, 116, 124, 123, 125, 124, 128, 127, 129, 128
Offset: 1

Views

Author

Jeffrey Shallit, Dec 31 2023

Keywords

Comments

a(n) <= (n/2)*log_2 n, with equality at powers of 2.

Crossrefs

Cf. A006519. A006520 (all positive signs), A136013.
Cf. A093347 (with powers of 3).

Programs

  • Mathematica
    a[1]=-1;a[n_]:=If[OddQ[n],a[n-1]-2^IntegerExponent[n,2],a[n-1]+2^IntegerExponent[n,2]];Table[a[n],{n,63}] (* James C. McMahon, Dec 31 2023 *)
  • PARI
    a(n) = fromdigits(Vec(Pol(binary(n))'),2) - bitand(n,1); \\ Kevin Ryde, Jan 01 2024
    
  • Python
    def A368595(n): return sum(map(lambda x:(x[0]+1)*(1<Chai Wah Wu, Jan 01 2024

Formula

a(n) = Sum_{i=1..n} (-1)^i*A006519(i).
a(n) = A136013(n) - (n mod 2). - Kevin Ryde, Jan 01 2024
Showing 1-9 of 9 results.