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 71-80 of 210 results. Next

A143232 Sum of denominators of Egyptian fraction expansion of A004001(n) - n/2.

Original entry on oeis.org

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

Views

Author

Dan Bron (j (at) bron.us), Jul 31 2008

Keywords

Comments

A004001 is the Hofstadter-Conway $10,000 Sequence and A004001(n) - n/2 is increasingly larger versions of the batrachion Blancmange function.

Examples

			a(43) = 5 because A004001(43) = 25, so (A004001(43) - (43/2)) = 3.5 and the Egyptian fraction expansion of 3.5 is (1/1)+(1/1)+(1/1)+(1/2), so the denominators are 1,1,1,2 which sums to 5.
		

Crossrefs

Cf. A004001.

Programs

  • J
    a004001 =: ((] +&:$: -) $:@:<:)@.(2&<) M.
    a143232 =: (+ 3 * 1&|)@:(a004001 - -:)"0
    
  • Magma
    A004001:=[n le 2 select 1 else Self(Self(n-1))+ Self(n-Self(n-1)):n in [1..125]];
    f:= func< x | 4*x - 3*Floor(x) >;
    A143232:= func< n | f(A004001[n] - n/2) >;
    [A143232(n): n in [1..100]]; // G. C. Greubel, Sep 10 2024
    
  • Mathematica
    HC[n_]:= HC[n]= If[n<3, 1, HC[HC[n-1]] +HC[n-HC[n-1]]]; (*HC=A004001*)
    f[x_]:= 4*x -3*Floor[x];
    A143232[n_]:= f[HC[n] -n/2];
    Table[A143232[n], {n,100}] (* G. C. Greubel, Sep 10 2024 *)
  • SageMath
    @CachedFunction
    def b(n): # b = A004001
        if n<3: return 1
        else: return b(b(n-1)) + b(n-b(n-1))
    def f(x): return x + 3 * (x - floor(x))
    def A143232(n): return f(b(n) - n/2)
    [A143232(n) for n in range(1,101)] # G. C. Greubel, Sep 10 2024

Formula

a(n) = Sum of denominators of Egyptian fraction expansion of A004001(n) - n/2 .
For practical purposes, a full Egyptian fraction algorithm is not necessary. Since the elements of A004001(n) - n/2 are either whole or their fractional part is .5, the sequence can be effected by a(n) = sefd(A004001(n) - n/2) with sefd(x) = x + 3 * (x - floor(x)) .

A147981 a(n) = A147952(A004001(n)).

Original entry on oeis.org

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

Views

Author

Roger L. Bagula, Nov 18 2008

Keywords

Crossrefs

Programs

  • Mathematica
    (*A004001*) g[0] = 0; g[1] = 1; g[2] = 1; g[n_] := g[n] = g[g[n - 1]] + g[n - g[n - 1]]; (*A147952*) f[0] = 0; f[1] = 1; f[2] = 1; f[n_] := f[n] = f[f[n - 2]] + If[Mod[n, 3] == 0, f[f[n/3]], If[Mod[n, 3] ==1, f[f[(n - 1)/3]], f[n - f[(n - 2)/3]]]]; Table[f[g[n]], {n, 0, 100}]

Formula

a(n) = A147952(A004001(n)) for n >= 0 with A004001(0) := 0.

Extensions

Name edited by Petros Hadjicostas, Apr 22 2020

A154280 List of pairs (a(n),b(n)): f(n) = A004001(n); a(n) = f(n) + a(n-1); b(n) = f(n)*b(n-1).

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 4, 2, 6, 4, 9, 12, 13, 48, 17, 192, 21, 768, 26, 3840, 32, 23040, 39, 161280, 46, 1128960, 54, 9031680, 62, 72253440, 70, 578027520, 78, 4624220160, 87, 41617981440, 97, 416179814400, 108, 4577977958400, 120, 54935735500800, 132
Offset: 0

Views

Author

Roger L. Bagula, Jan 06 2009

Keywords

Crossrefs

Cf. A004001.

Programs

  • Mathematica
    (*A004001*) f[0] = 0; f[1] = 1; f[2] = 1; f[n_] := f[n] = f[f[n - 1]] + f[n - f[n - 1]];
    a[0] = 0; a[n_] := a[n] = f[n] + a[n - 1];
    b[0] = 1; b[1] = 1; b[n_] := b[n] = (f[n])*b[n - 1];
    Flatten[Table[{a[n], b[n]}, {n, 0, 30}]]

A176047 Triangle t(n,m) = A004001(m+1)+A004001(n-m+1)-A004001(n+1) read by rows, 0<=m<=n.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, -1, 0, 1, 0, -1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Apr 07 2010

Keywords

Examples

			1;
1, 1;
1, 0, 1;
1, 1, 1, 1;
1, 0, 1, 0, 1;
1, 0, 0, 0, 0, 1;
1, 1, 1, 0, 1, 1, 1;
		

Programs

Extensions

Mutually compatible definition and terms installed. Erroneous row sums removed. - R. J. Mathar, Jul 11 2012

A283525 Remainder when sum of first n terms of A004001 is divided by 3*n.

Original entry on oeis.org

1, 2, 4, 6, 9, 13, 17, 21, 26, 2, 6, 10, 15, 20, 25, 30, 36, 43, 51, 0, 6, 13, 21, 29, 38, 47, 56, 66, 76, 86, 3, 10, 18, 27, 37, 48, 60, 72, 85, 99, 114, 3, 16, 30, 44, 59, 74, 89, 105, 122, 139, 1, 16, 31, 47, 63, 79, 95, 112, 129, 146, 163, 180, 5, 20, 36, 53, 71, 90, 110, 130, 151, 173, 196, 220, 16, 38, 61, 85, 109
Offset: 1

Views

Author

Altug Alkan, Mar 10 2017

Keywords

Comments

Sequence represents b(n, 3) where b(n, i) = (Sum_{k=1..n} A004001(k)) mod (n*i). See also A282891, A283501 and corresponding illustrations in Links section.

Crossrefs

Programs

  • Maple
    A004001:= proc(n) option remember; procname(procname(n-1)) +procname(n-procname(n-1)) end proc:
    A004001(1):= 1: A004001(2):= 1:
    L:= ListTools[PartialSums](map(A004001, [$1..1000])):
    seq(L[i] mod (3*i), i=1..1000); # after Robert Israel at A282891
  • Mathematica
    b[1] = 1; b[2] = 1; b[n_] := b[n] = b[b[n - 1]] + b[n - b[n - 1]]; a[n_] := Mod[Sum[b[k], {k, n}], 3 n]; Array[a, 80] (* Robert G. Wilson v, Mar 13 2017 *)
  • PARI
    a=vector(1000); a[1]=a[2]=1; for(n=3, #a, a[n]=a[a[n-1]]+a[n-a[n-1]]); vector(#a, n, sum(k=1, n, a[k]) % (3*n))

Formula

a(n) = (Sum_{k=1..n} A004001(k)) mod (3*n).

A317921 a(1) = a(2) = 1; for n >= 3, a(n) = 3*a(t(n)) - a(n-t(n)) where t = A004001.

Original entry on oeis.org

1, 1, 2, 2, 5, 5, 4, 4, 13, 13, 10, 7, 7, 7, 8, 8, 35, 35, 26, 17, 8, 8, 8, 8, 11, 14, 17, 17, 17, 17, 16, 16, 97, 97, 70, 43, 16, -11, -11, -11, -11, -11, -2, 7, 16, 25, 34, 43, 43, 43, 43, 43, 43, 43, 40, 37, 34, 31, 31, 31, 31, 31, 32, 32, 275, 275, 194, 113, 32, -49, -130, -130, -130, -130, -130
Offset: 1

Views

Author

Altug Alkan, Aug 11 2018

Keywords

Comments

Sequence has a fractal-like structure. Each generation (between consecutive powers of 2) provides a pattern which looks like an EKG signal since maximum value of a(n) (in corresponding generation) is damped step by step.

Crossrefs

Programs

  • PARI
    t=vector(99); t[1]=t[2]=1; for(n=3, #t, t[n] = t[n-t[n-1]]+t[t[n-1]]); a=vector(99); a[1]=a[2]=1; for(n=3, #a, a[n] = 3*a[t[n]]-a[n-t[n]]); a

A051284 a(n) is the number k, 2^n < k < 2^(n+1), such that k/c(k) is a minimum in the interval, where c(k) is Hofstadter-Conway sequence A004001.

Original entry on oeis.org

3, 6, 11, 23, 44, 92, 178, 370, 719, 1487, 2897, 5969, 11651, 22223, 45083, 89516, 181385, 353683, 722589, 1423078, 2903564, 5696576, 11635316, 22866150, 46704206, 91835554, 187298550
Offset: 1

Views

Author

Keywords

Comments

The ratio of k/c(k) (where c(k)=A004001) reaches a maximum of 2.0 when n is a power of 2. When n=6 the ratio has a relative minimum of 1.5, so a(2) = 6.

Crossrefs

Cf. A004001.

Extensions

a(26)-a(27) and title clarified by Sean A. Irvine, Sep 01 2021

A087741 a(n) = 1+Abs[A000040[A004001[n]]-A004001[A000040[n]]].

Original entry on oeis.org

2, 1, 1, 2, 3, 2, 3, 5, 4, 4, 2, 5, 6, 7, 9, 12, 10, 4, 5, 2, 4, 5, 5, 9, 9, 11, 12, 7, 8, 10, 12, 15, 14, 14, 16, 13, 14, 19, 16, 15, 13, 14, 10, 7, 10, 9, 14, 19, 15, 15, 16, 14, 14, 16, 3, 9, 14, 16, 17, 20, 21, 27, 39, 41, 36, 37, 36, 38, 36, 30, 34, 34, 33, 30, 31, 32, 26, 28, 26, 29
Offset: 1

Views

Author

Roger L. Bagula, Oct 01 2003

Keywords

Comments

A "commutator" between the sequence of primes A000040 and the Conway-Hofstadter A004001 sequence.
This sequence has a nice graph. ListPlot[a,PlotRange->All,PlotJoined->True]

Crossrefs

Programs

  • Mathematica
    Conway[n_Integer?Positive] := Conway[n] =Conway[Conway[n-1]] + Conway[n - Conway[n-1]] Conway[1] = Conway[2]= 1 digits=200 a=Table[1+Abs[Prime[Conway[n]]-Conway[Prime[n]]], {n, 1, digits}]

A089996 a(n) = primes generated by the function ( f[n_]=Floor[(A004001[n]*Prime[n])*Log[2]/(2*PrimePi[n]+1)]).

Original entry on oeis.org

3, 5, 13, 17, 41, 53, 59, 61, 101, 127, 151, 167, 193, 269, 277, 281, 283, 313, 359, 419, 421, 439, 463, 467, 499, 509, 619, 691, 743, 787, 853, 859, 907, 1061, 1069, 1097, 1181, 1229, 1249, 1277, 1289, 1303, 1381, 1427, 1453, 1531, 1571, 1583, 1609, 1741
Offset: 1

Views

Author

Roger L. Bagula, Jan 14 2004

Keywords

Comments

A prime generating function based on the primes, A004001 and the distribution of the primes.
By itself the integer function : f[n_]=Floor[(Conway[n]*Prime[n])*Log[2]/(2*PrimePi[n]+1)] is not very interesting: it is made to match the function g[n_]=n*Log[n]

Crossrefs

Cf. A004001.

Programs

  • Mathematica
    digits=6*200 Conway[n_Integer?Positive] := Conway[n] =Conway[Conway[n-1]] + Conway[n - Conway[n-1]] Conway[1] = Conway[2] = 1 (* PrimeQ sieve function *) a=Table[If[PrimeQ[Floor[(Conway[n]*Prime[n])*Log[2]/(2*PrimePi[n]+1)]]==True, Floor[(Conway[n]*Prime[n])*Log[2]/(2*PrimePi[n]+1)], 0], {n, 1, digits}] (* eliminate the extra zeros *) b=Union[a] Delete[b, 1]

A094528 Triangle T(n,k) read by rows related to A004001.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Jun 05 2004

Keywords

Formula

T(n, k)=b(2^k+n)-2^(k-1) where b(n)=A004001(n) (n=1, 2, 3, ... 1<=k<=n)
Previous Showing 71-80 of 210 results. Next