[go: up one dir, main page]

login
Revision History for A239447 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

newer changes | Showing entries 11-19
#9 by N. J. A. Sloane at Tue Mar 18 18:36:33 EDT 2014
STATUS

editing

approved

#8 by N. J. A. Sloane at Tue Mar 18 18:36:04 EDT 2014
NAME

Partial sum sums of A030101.

CROSSREFS

Partial sum of A030101

Cf. A030101.

KEYWORD

nonn,more,changed

STATUS

proposed

editing

Discussion
Tue Mar 18
18:36
N. J. A. Sloane: "Partial sums" is correct.
#7 by Olivier Pirson at Tue Mar 18 18:31:33 EDT 2014
STATUS

editing

proposed

#6 by Olivier Pirson at Tue Mar 18 18:27:49 EDT 2014
NAME

Sum Partial sum of A030101

CROSSREFS

Sum Partial sum of A030101

Discussion
Tue Mar 18
18:31
Olivier Pirson: Partial sum, I guess: a(n) = sum_{i=1}^n a'(n)
#5 by Wesley Ivan Hurt at Tue Mar 18 18:10:37 EDT 2014
STATUS

proposed

editing

#4 by Olivier Pirson at Tue Mar 18 17:52:47 EDT 2014
STATUS

editing

proposed

Discussion
Tue Mar 18
18:10
Wesley Ivan Hurt: Olivier, Did you mean Partial Sums of A030101(n)?
#3 by Olivier Pirson at Tue Mar 18 17:51:59 EDT 2014
CROSSREFS

Sum of A030101

#2 by Olivier Pirson at Tue Mar 18 17:48:36 EDT 2014
NAME

allocated for Olivier Pirson

Sum of A030101

DATA

0, 1, 2, 5, 6, 11, 14, 21, 22, 31, 36, 49, 52, 63, 70, 85, 86, 103, 112, 137, 142, 163, 176, 205, 208, 227, 238, 265, 272, 295

OFFSET

0,3

LINKS

Project Euler, <a href="http://projecteuler.net/problem=463">Problem 463</a>

FORMULA

a(4n) = 6 a(2n) - 5 a(n) - 3 a(n-1) - 1

a(4n + 1) = 2 a(2n+1) + 4 a(2n) - 6 a(n) - 2 a(n-1) - 1

a(4n + 2) = 3 a(2n+1) + 3 a(2n) - 6 a(n) - 2 a(n-1) - 1

a(4n + 3) = 6 a(2n+1) - 8 a(n) - 1

PROG

(Python) A = {0: 0, 1: 1, 2: 2, 3: 5}

.

def a(n):

....a_n = A.get(n)

....if a_n is not None:

........return a_n

.

....q, r = divmod(n, 4)

....if r == 0:

........a_n = a(q*2)*6 - a(q)*5 - a(q - 1)*3 - 1

....elif r == 1:

........a_n = a(q*2 + 1)*2 + a(q*2)*4 - a(q)*6 - a(q - 1)*2 - 1

....elif r == 2:

........a_n = a(q*2 + 1)*3 + a(q*2)*3 - a(q)*6 - a(q - 1)*2 - 1

....else:

........a_n = a(q*2 + 1)*6 - a(q)*8 - 1

.

....A[n] = a_n # memoization

.

....return a_n

CROSSREFS

Sum of A030101

KEYWORD

allocated

nonn

AUTHOR

Olivier Pirson, Mar 18 2014

STATUS

approved

editing

#1 by Olivier Pirson at Tue Mar 18 17:48:36 EDT 2014
NAME

allocated for Olivier Pirson

KEYWORD

allocated

STATUS

approved