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.

A108514 If n is a power of 2, a(n)=n; otherwise a(n) = (p-1)*n/p where p = smallest odd prime divisor of n.

This page as a plain text file.
%I A108514 #15 Oct 28 2017 09:32:55
%S A108514 1,2,2,4,4,4,6,8,6,8,10,8,12,12,10,16,16,12,18,16,14,20,22,16,20,24,
%T A108514 18,24,28,20,30,32,22,32,28,24,36,36,26,32,40,28,42,40,30,44,46,32,42,
%U A108514 40,34,48,52,36,44,48,38,56,58,40,60,60,42,64,52,44,66,64,46,56,70,48,72,72,50
%N A108514 If n is a power of 2, a(n)=n; otherwise a(n) = (p-1)*n/p where p = smallest odd prime divisor of n.
%H A108514 David A. Corneth, <a href="/A108514/b108514.txt">Table of n, a(n) for n = 1..10000</a>
%H A108514 Z. Nedev, <a href="http://dx.doi.org/10.12988/imf.2014.411">A Reduced Computational Complexity Strategy for the Magnus-Derek Game</a>, International Mathematical Forum, Vol. 9, 2014, no. 7, pp. 325 - 333. See p. 326.
%H A108514 Z. Nedev and S. Muthukrishnan, <a href="http://dimacs.rutgers.edu/TechnicalReports/abstracts/2005/2005-22.html">The Nagger-Mover Game</a>, DIMACS Tech. Report 2005-22.
%p A108514 with(numtheory): a:=proc(n) local nn: nn:=factorset(n): if n=1 then 1 elif nn={2} then n elif nn[1]=2 then (nn[2]-1)*n/nn[2] else (nn[1]-1)*n/nn[1] fi end:
%t A108514 Array[If[IntegerQ@ Log2@ #1, #1, #1 (#2 - 1)/#2] & @@ {#, SelectFirst[FactorInteger[#][[All, 1]], # > 2 &]} &, 75] (* _Michael De Vlieger_, Oct 25 2017 *)
%o A108514 (PARI) first(n) = {my(res = vector(n, i, i)); forprime(p = 3, n, for(k = 1, n\p, if(res[k*p] == k*p, res[k*p]*=(p-1)/p))); res} \\ _David A. Corneth_, Oct 25 2017
%Y A108514 Cf. A108738.
%K A108514 nonn
%O A108514 1,2
%A A108514 S. Muthukrishnan (muthu(AT)research.att.com), Jun 23 2005
%E A108514 Definition revised by _N. J. A. Sloane_, Oct 28 2017 at the suggestion of _Michel Marcus_.