login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A294076 Absolute difference between n-th stella octangula number (A007588) and the nearest perfect power (A001597). 0
1, 0, 2, 2, 1, 2, 15, 3, 8, 5, 35, 50, 37, 25, 2, 11, 16, 8, 18, 10, 104, 5, 42, 25, 68, 104, 157, 35, 195, 92, 146, 15, 32, 17, 174, 134, 251, 145, 145, 263, 204, 160, 91, 230, 245, 124, 145, 337, 236, 24, 50, 26, 264, 415, 153, 234, 473, 552, 459, 182, 291 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

There are only two square stella octangula numbers, namely those corresponding to n = 1 and n = 169, so a(1) = 0 and a(169) = 0 (cf. Wikipedia link).

LINKS

Table of n, a(n) for n=0..60.

Wikipedia, Stella octangula number

MATHEMATICA

f[n_, i_: 1] := Block[{k = n, j = If[i == 1, 1, -1]}, While[Nor[k == 1, GCD @@ FactorInteger[k][[All, 2]] > 1], k = k + j]; k]; {1}~Join~Array[Min@ Abs@ {# - f[#], f[#, 0] - #} &[# (2 #^2 - 1)] &, 60] (* Michael De Vlieger, Feb 21 2018 *)

PROG

(PARI) a007588(n) = n*(2*n^2-1)

is_a001597(n) = ispower(n) || n==1

nearestpower(n) = my(x=0); while(1, if(x < n, if(is_a001597(n-x), return(n-x), if(is_a001597(n+x), return(n+x))), if(is_a001597(n+x), return(n+x))); x++)

a(n) = abs(a007588(n)-nearestpower(a007588(n)))

CROSSREFS

Cf. A001597, A007588.

Sequence in context: A192395 A014243 A124839 * A117046 A268192 A077653

Adjacent sequences:  A294073 A294074 A294075 * A294077 A294078 A294079

KEYWORD

nonn

AUTHOR

Felix Fröhlich, Feb 07 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 22 11:46 EDT 2019. Contains 322330 sequences. (Running on oeis4.)