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.

A174869 a(n) is 0 if n is a power of 2, otherwise the smallest k > 0 such that A006530(n+k) < A006530(n).

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 1, 0, 7, 2, 1, 4, 1, 1, 1, 0, 1, 14, 1, 4, 3, 2, 1, 8, 2, 1, 5, 2, 1, 2, 1, 0, 2, 1, 1, 28, 1, 1, 1, 8, 1, 3, 1, 1, 3, 2, 1, 16, 1, 4, 1, 2, 1, 10, 1, 4, 3, 2, 1, 4, 1, 1, 1, 0, 1, 4, 1, 2, 1, 2, 1, 56, 1, 1, 6, 1, 3, 2, 1, 1, 47, 2, 1, 6, 3, 1, 1, 2, 1, 6, 5, 3, 2, 1, 1, 32, 1, 2, 1, 8, 1, 2, 1
Offset: 1

Views

Author

Vladimir Shevelev, Mar 31 2010

Keywords

Comments

a(n)=1 if the index n is an odd prime.

Crossrefs

Programs

  • Maple
    A006530 := proc(n) option remember; if n = 1 then 1; else max(op(numtheory[factorset](n)) ) ; end if; end proc:
    A174869 := proc(n) if n <= 2 then 0; else gpf := A006530(n) ; if gpf = 2 then 0; else for k from 1 do if A006530(n+k) < gpf then return k; end if; end do: end if; end if; end proc:
    seq(A174869(n),n=1..120) ; # R. J. Mathar, Aug 10 2010
  • Mathematica
    Block[{s = Array[FactorInteger[#][[-1, 1]] &, 120]}, Array[If[IntegerQ@ Log2[#], 0, Block[{k = 1, n = s[[#]]}, While[n <= s[[# + k]], k++; If[# + k > Length[s], AppendTo[s, FactorInteger[# + k][[-1, 1]] ]] ]; k]] &, 102, 2]] (* Michael De Vlieger, Apr 06 2021 *)
  • PARI
    A006530(n) = if(n>1, vecmax(factor(n)[, 1]), 1);
    A174869(n) = if(!bitand(n,n-1), 0, my(gpf=A006530(n)); for(k=1,oo,if(A006530(n+k)Antti Karttunen, Apr 06 2021

Extensions

More terms from R. J. Mathar, Aug 10 2010