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

A063920 Numbers k such that k = 2*phi(k) + phi(phi(k)).

Original entry on oeis.org

10, 14, 20, 28, 40, 56, 80, 112, 160, 224, 320, 448, 640, 896, 1280, 1792, 2560, 3584, 5120, 7168, 10240, 14336, 20480, 28672, 40960, 57344, 81920, 114688, 163840, 229376, 327680, 458752, 655360, 917504, 1310720, 1835008, 2621440, 3670016, 5242880, 7340032, 10485760
Offset: 0

Views

Author

Jason Earls, Aug 31 2001

Keywords

Comments

Previous name was: t(n) = z(n) where t(n)= |eulerphi(n)-n| and z(n)= t(t(n)-n).

Crossrefs

Cf. A070875 (the same sequence, if we omit the two initial terms).

Programs

  • Magma
    [(12-2*(-1)^n)*2^Floor(n/2): n in [0..50]]; // Vincenzo Librandi, Feb 29 2016
  • Mathematica
    CoefficientList[Series[(10 + 14 x) / (1 - 2 x^2), {x, 0, 40}], x] (* Vincenzo Librandi, Feb 29 2016 *)
  • PARI
    t(n) = abs(eulerphi(n)-n); z(n) = t(t(n)-n);
    for(n=1,113, if(t(n)==z(n),print1(n, ", ")))
    

Formula

G.f.: (10 + 14x)/(1 - 2x^2).
a(n) = (12-2*(-1)^n) * 2^floor(n/2). - Ralf Stephan, Jul 19 2013
Sum_{n>=0} 1/a(n) = 12/35. - Amiram Eldar, Mar 28 2022

Extensions

Better name from Ivan Neretin, Feb 28 2016

A281392 Number of occurrences of "01" as a subsequence in the binary expansion of n.

Original entry on oeis.org

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

Views

Author

Jeffrey Shallit, Jan 21 2017

Keywords

Comments

By "subsequence" we do not demand that occurrences are contiguous. Furthermore, we assume that the binary expansion of n begins with a 0, and is read starting with the most significant digit.

Examples

			For n = 5, the number of occurrences of 01 as a subsequence of 0101 is 3.
		

Crossrefs

Cf. A055941, which gives the analogous sequence for the pattern "10" instead of "01".
Cf. A000079 (a(n)=1), A007283 (a(n)=2), A070875 (a(n)=3).

Programs

  • Maple
    f:= proc(n) option remember;
      if n::even then procname(n/2)
      elif n mod 4 = 3 then - procname((n-3)/4) + 2*procname((n-1)/2)
    elif n mod 8 = 1 then -procname((n+3)/4) + 2*procname((n+1)/2)
    elif n mod 16 = 5 then -2*procname((n+3)/8) + 2*procname((n-1)/4) + procname((n+5)/2)
    elif n mod 16 = 13 then -procname((n-13)/16) +procname((n-5)/8) + procname((n-3)/2)
    fi;
    end proc:
    f(0):= 0: f(1):= 1: f(5):= 3:
    map(f, [$0..200]); # Robert Israel, Mar 11 2020
  • Mathematica
    f[n_] := f[n] = Which[
    EvenQ[n], f[n/2],
    Mod[n, 4] == 3, -f[(n-3)/4] + 2*f[(n-1)/2],
    Mod[n, 8] == 1, -f[(n+3)/4] + 2*f[(n+1)/2],
    Mod[n, 16] == 5, -2*f[(n+3)/8] + 2*f[(n-1)/4] + f[(n+5)/2],
    Mod[n, 16] == 13, -f[(n-13)/16] + f[(n-5)/8] + f[(n-3)/2]];
    f[0] = 0; f[1] = 1; f[5] = 3;
    Map[f, Range[0, 200]] (* Jean-François Alcover, Sep 19 2022, after Robert Israel *)

Formula

Completely defined by the recurrence relations
a(2n) = a(n); a(4n+3) = -a(n) + 2a(2n+1); a(8n+1) = -a(2n+1) + 2a(4n+1); a(16n+5) = -2a(2n+1) + 2a(4n+1) + a(8n+5);
a(16n+13) = -a(n) + a(2n+1) + a(8n+5) with a(0) = 0, a(1) = 1 and a(5) = 3.
Previous Showing 11-12 of 12 results.