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.

Showing 1-10 of 11 results. Next

A276572 Simple self-inverse permutation of natural numbers: after a(0)=0, list each block of A260734(n) numbers in reverse order, from A260732(n) to A260733(1+n).

Original entry on oeis.org

0, 1, 3, 2, 5, 4, 9, 8, 7, 6, 13, 12, 11, 10, 18, 17, 16, 15, 14, 23, 22, 21, 20, 19, 30, 29, 28, 27, 26, 25, 24, 37, 36, 35, 34, 33, 32, 31, 44, 43, 42, 41, 40, 39, 38, 52, 51, 50, 49, 48, 47, 46, 45, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 71, 70, 69, 68, 67, 66, 65, 64, 63, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72
Offset: 0

Views

Author

Antti Karttunen, Sep 07 2016

Keywords

Comments

Maps between A276573 and A276574.

Crossrefs

Programs

  • Mathematica
    f[n_] := NestWhileList[# - (If[First@ # > 0, 1, Length[First@ Split@ #] + 1] &@ SquaresR[Range@ 4, #]) &, n^2, # != 0 &]; t = Table[Table[n, {Length[#] - 1 &@ NestWhileList[# - (If[First@ # > 0, 1, Length[First@ Split@ #] + 1] &@ SquaresR[Range@ 4, #]) &, ((n + 1)^2) - 1, # != (n^2) - 1 &]}], {n, 20}] // Flatten ; {0}~Join~Table[Length@ f@ t[[n]] - 1 + Length@ f[t[[n]] + 1] - n - 2, {n, 81}] (* Michael De Vlieger, Sep 08 2016 *)
  • Scheme
    (define (A276572 n) (if (zero? n) n (+ (- (A260733 (+ 1 (A276571 n))) n) (A260732 (A276571 n)))))

Formula

a(0) = 0; for n >= 1, a(n) = (A260733(1+A276571(n))-n)+A260732(A276571(n)).

A276573 The infinite trunk of least squares beanstalk: The only infinite sequence such that a(0) = 0 and a(n-1) = a(n) - least number of squares (A002828) that sum to a(n).

Original entry on oeis.org

0, 3, 6, 8, 11, 15, 16, 18, 21, 24, 27, 30, 32, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 63, 64, 67, 70, 72, 75, 78, 80, 83, 85, 88, 90, 93, 96, 99, 102, 105, 108, 112, 115, 117, 120, 123, 126, 128, 131, 134, 136, 139, 143, 144, 147, 149, 152, 155, 158, 160, 162, 165, 168, 171, 173, 176, 179, 183, 186, 189, 192, 195
Offset: 0

Views

Author

Antti Karttunen, Sep 07 2016

Keywords

Crossrefs

Cf. A002828, A005563, A255131, A260731, A260733, A262689, A276572, A276574, A276575 (first differences), A277016 (squares present), A277015 (their square roots), A277888 (primes), A278486 (numbers one more than a prime), A278265, A278487, A278488, A278491 (another subsequence), A278497, A278498, A278499, A278513, A278516, A278517, A278518, A278519, A278521, A278522.
Cf. A277890 & A277891 (number of even and odd terms in each range. The latter seem to be slightly more numerous), A277889.
Positions of nonzero terms in A278515.
Subsequence of A278489, no common terms with A278490.
Cf. also A179016, A259934, A276583, A276613, A276623 for similar constructions.

Programs

Formula

a(n) = A276574(A276572(n)).
Other identities and observations. For all n >= 0:
A260731(a(n)) = n.
a(A260733(n+1)) = A005563(n).
A278517(n) <= a(n) <= A278519(n).
A010873(a(n)) = A278499(n). [Terms reduced modulo 4.]
A010877(a(n)) = A278488(n). [modulo 8.]
A046523(a(n)) = A278497(n). [Least number with the same prime signature.]
A008683(a(n)) = A278513(n).
A065338(a(n)) = A278498(n).
A278509(a(n)) = A278265(n).
A278216(a(n)) = A278516(n). [Number of children the n-th node of the trunk has.]

Extensions

Definition clarified and more identities added to the Formula section by Antti Karttunen, Nov 28 2016

A255131 n minus the least number of squares that add up to n: a(n) = n - A002828(n).

Original entry on oeis.org

0, 0, 0, 0, 3, 3, 3, 3, 6, 8, 8, 8, 9, 11, 11, 11, 15, 15, 16, 16, 18, 18, 19, 19, 21, 24, 24, 24, 24, 27, 27, 27, 30, 30, 32, 32, 35, 35, 35, 35, 38, 39, 39, 40, 41, 43, 43, 43, 45, 48, 48, 48, 50, 51, 51, 51, 53, 54, 56, 56, 56, 59, 59, 59, 63, 63, 63, 64, 66, 66, 67, 67, 70, 71, 72, 72, 73, 74, 75, 75, 78, 80, 80, 80, 81
Offset: 0

Views

Author

Antti Karttunen, Feb 24 2015

Keywords

Comments

The associated beanstalk-sequence starts from a(0) as: 0, 3, 6, 8, 11, 15, 16, 18, 21, ... (A276573).

Examples

			a(0) = 0, because no squares are needed for an empty sum, and 0 - 0 = 0.
a(3) = 0, because 3 cannot be represented as a sum of less than three squares (1+1+1), and 3 - 3 = 0.
a(4) = 3, because 4 can be represented as a sum of just one square (namely 4 itself), and 4 - 1 = 3.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local F, x;
       if issqr(n) then return n-1 fi;
       if nops(select(t -> t[1] mod 4 = 3 and t[2]::odd, ifactors(n)[2])) = 0 then return n-2 fi;
       x:= n/4^floor(padic:-ordp(n, 2)/2);
       if x mod 8 = 7 then n-4 else n-3 fi
    end proc:
    f(0):= 0:
    map(f, [$0..100]); # Robert Israel, Mar 27 2018
  • Mathematica
    {0}~Join~Table[n - (If[First@ # > 0, 1, Length[First@ Split@ #] + 1] &@ SquaresR[Range@ 4, n]), {n, 84}] (* Michael De Vlieger, Sep 08 2016, after Harvey P. Dale at A002828 *)

Formula

a(n) = n - A002828(n).
a(n) = A260740(n) + A062535(n).

A260731 a(n) = Number of steps to reach 0 starting from x=n and using the iterated process: x -> x - A002828(x), where A002828(x) = the least number of squares that add up to x.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 2, 2, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 19, 19, 19, 20, 20, 20, 20, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 27, 27, 28, 28, 28, 29, 29, 29, 30, 31, 31, 31, 32, 32, 32, 32, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 37, 37, 38
Offset: 0

Views

Author

Antti Karttunen, Aug 12 2015

Keywords

Crossrefs

Left inverse of A276573, A278517 and A278519. A278518(n) gives the number of times n occurs (run lengths).
Cf. also A261221.

Programs

  • Mathematica
    A002828[n_] := Which[n == 0, 0, SquaresR[1, n] > 0, 1, SquaresR[2, n] > 0, 2, SquaresR[3, n] > 0, 3, True, 4]; a[0] = 0; a[n_] := a[n] = 1 + a[n - A002828[n]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Nov 14 2016 *)

Formula

a(0) = 0; for >= 1, a(n) = 1 + A260731(A255131(n)).
From Antti Karttunen, Nov 28 2016: (Start)
For all n >= 0, a(A278517(n)) = a(A278519(n)) = a(A276573(n)) = n.
(End)

A260734 a(n) = number of steps needed to reach (n^2)-1 when starting from k = ((n+1)^2)-1 and repeatedly applying the map that replaces k with k - A002828(k), where A002828(k) = the least number of squares that add up to k.

Original entry on oeis.org

1, 2, 2, 4, 4, 5, 5, 7, 7, 7, 8, 10, 9, 10, 10, 13, 13, 14, 13, 15, 15, 16, 17, 17, 19, 19, 19, 20, 20, 22, 22, 23, 24, 25, 24, 26, 27, 25, 28, 29, 29, 29, 30, 31, 33, 33, 33, 34, 35, 35, 37, 36, 39, 37, 38, 40, 42, 40, 42, 42, 43, 42, 45, 45, 45, 48, 45, 49, 50, 50, 48, 53, 50, 51, 54, 52, 53, 54, 56, 56, 56, 58, 59, 59, 60, 60, 60, 61, 62, 62, 62, 65, 66, 66, 65
Offset: 1

Views

Author

Antti Karttunen, Aug 12 2015

Keywords

Crossrefs

First differences of both A260732 and A260733.
Cf. also A261224.

Programs

  • Mathematica
    Table[Length[#] - 1 &@ NestWhileList[# - (If[First@ # > 0, 1, Length[ First@ Split@ #] + 1] &@ SquaresR[Range@ 4, #]) &, ((n + 1)^2) - 1, # != (n^2) - 1 &], {n, 95}] (* Michael De Vlieger, Sep 08 2016, after Harvey P. Dale at A002828 *)

Formula

a(n) = A260731(((n+1)^2)-1) - A260731((n^2)-1). [The definition.]
Equally, for all n >= 1:
a(n) = A260731((n+1)^2) - A260731(n^2).
a(n) = A260732(n+1) - A260732(n).
a(n) = A260733(n+1) - A260733(n).

A260732 a(n) = number of steps needed to reach zero when starting from k = n^2 and repeatedly applying the map that replaces k with k - {the least number of squares (A002828) that add up to k}.

Original entry on oeis.org

0, 1, 2, 4, 6, 10, 14, 19, 24, 31, 38, 45, 53, 63, 72, 82, 92, 105, 118, 132, 145, 160, 175, 191, 208, 225, 244, 263, 282, 302, 322, 344, 366, 389, 413, 438, 462, 488, 515, 540, 568, 597, 626, 655, 685, 716, 749, 782, 815, 849, 884, 919, 956, 992, 1031, 1068, 1106, 1146, 1188, 1228, 1270, 1312, 1355, 1397, 1442, 1487, 1532, 1580, 1625
Offset: 0

Views

Author

Antti Karttunen, Aug 12 2015

Keywords

Crossrefs

Partial sums of A260734.
Essentially one more than A260733.
Cf. also A261222.

Programs

  • Mathematica
    Table[Length[#] - 1 &@ NestWhileList[# - (If[First@ # > 0, 1, Length[ First@ Split@ #] + 1] &@ SquaresR[Range@ 4, #]) &, n^2, # != 0 &], {n, 0, 68}] (* Michael De Vlieger, Sep 08 2016, after Harvey P. Dale at A002828 *)

Formula

a(n) = A260731(n^2).
For all n >= 1: a(n) = 1 + A260733(n).

A261223 a(n) = number of steps to reach 0 when starting from k = (n*n)-1 and repeatedly applying the map that replaces k with k - A053610(k), where A053610(k) = the number of positive squares that sum to k using the greedy algorithm.

Original entry on oeis.org

0, 1, 3, 5, 8, 11, 14, 18, 23, 28, 34, 40, 47, 54, 61, 69, 77, 86, 96, 106, 117, 128, 140, 152, 164, 177, 190, 204, 218, 233, 248, 264, 281, 298, 316, 334, 353, 372, 391, 411, 432, 453, 474, 496, 518, 541, 564, 588, 612, 637, 663, 689, 716, 743, 771, 799, 827, 856, 886, 916, 947, 978, 1009, 1041, 1073, 1106, 1139, 1173, 1207, 1242, 1277, 1313, 1350, 1387, 1425, 1463, 1502, 1541
Offset: 1

Views

Author

Antti Karttunen, Aug 12 2015

Keywords

Crossrefs

One less than A261222.
Cf. also A260733, A261228.

Programs

  • Mathematica
    Table[-2 + Length@ NestWhileList[# - Block[{m = #, c = 1}, While[a = (# - Floor[Sqrt@ #]^2) &@ m; a != 0, c++; m = a]; c] &, (n + 1)^2, # != 0 &], {n, 0, 77}] (* Michael De Vlieger, Sep 08 2016, after Jud McCranie at A053610 *)

Formula

a(n) = A261221((n^2)-1).
a(n) = A261222(n)-1.

A276575 After a(0)=0, the first differences of A276573.

Original entry on oeis.org

0, 3, 3, 2, 3, 4, 1, 2, 3, 3, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 4, 1, 3, 3, 2, 3, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 4, 3, 2, 3, 3, 3, 2, 3, 3, 2, 3, 4, 1, 3, 2, 3, 3, 3, 2, 2, 3, 3, 3, 2, 3, 3, 4, 3, 3, 3, 3, 3, 2, 3, 4, 3, 3, 3, 3, 2, 3, 3, 4, 2, 3, 4, 3, 2, 3, 3, 4, 1, 3, 2, 3, 3, 3, 2, 3, 2, 3, 3, 3, 2, 3, 3, 2, 2, 3, 3, 2, 3, 3, 3, 3, 2, 3, 3, 2, 3
Offset: 0

Views

Author

Antti Karttunen, Sep 07 2016

Keywords

Crossrefs

Formula

a(n) = A002828(A276573(n)).
a(0) = 0; for n >= 1, a(n) = A276573(n) - A276573(n-1).
Other identities.
For all n >= 1, a(A260731(A132592(n))) = a(A260733(A001541(n))) = 2. [This is implied by the fact observed in the Polster video. Of course 2's occur at other points too.]

A277891 a(n) = number of odd numbers encountered before reaching (n^2)-1 when starting from k = ((n+1)^2)-1 and iterating map k -> k - A002828(k).

Original entry on oeis.org

1, 0, 2, 1, 2, 2, 4, 2, 4, 3, 4, 4, 6, 5, 7, 6, 5, 6, 7, 7, 6, 6, 11, 9, 9, 9, 12, 9, 10, 9, 11, 11, 12, 11, 14, 13, 15, 12, 14, 14, 16, 14, 15, 13, 15, 17, 18, 17, 14, 17, 19, 18, 20, 17, 22, 19, 22, 20, 20, 22, 20, 22, 23, 22, 24, 25, 22, 22, 25, 26, 26, 25, 28, 24, 30, 26, 28, 29, 27, 27, 28, 32, 29, 28, 32, 32, 29, 31, 30, 29, 35, 33, 32, 32, 35, 34, 35, 36
Offset: 1

Views

Author

Antti Karttunen, Nov 08 2016

Keywords

Comments

The starting point ((n+1)^2)-1 of the iteration is included if it is odd, but the ending point (n^2)-1 is never included in the count.
a(n) = number of odd numbers on row n of A276574, after the initial zero-row.
On the average, the odd terms in A276573 (A276574) seem to occur more frequently than the even terms. (The last point in range 1..10000 where a(n) <= A277890(n) is n=862). See also comments in A277487 and the plot of ratio a(n)/A277890(n), also the plot of A277889.

Examples

			For n=6, we start iterating from k = ((6+1)^2)-1 = 48, with k -> k - A002828(k), to obtain 48 -> 45 -> 43 -> 40 -> 38 before reaching 35 (which is 6^2 - 1, an ending point and thus not included in the count), and the only odd numbers before that were 45 and 43, thus a(6) = 2.
		

Crossrefs

Programs

  • PARI
    istwo(n:int)=my(f); if(n<3, return(n>=0); ); f=factor(n>>valuation(n, 2)); for(i=1, #f[, 1], if(bitand(f[i, 2], 1)==1&&bitand(f[i, 1], 3)==3, return(0))); 1
    isthree(n:int)=my(tmp=valuation(n, 2)); bitand(tmp, 1)||bitand(n>>tmp, 7)!=7
    A002828(n)=if(issquare(n), !!n, if(istwo(n), 2, 4-isthree(n))) \\ From Charles R Greathouse IV, Jul 19 2011
    A277891(n) = { my(orgk = ((n+1)^2)-1); my(k = orgk, s = 0); while(((k == orgk) || !issquare(1+k)), s = s + (k%2); k = k - A002828(k)); s; };
    for(n=1, 10000, write("b277891.txt", n, " ", A277891(n)));
    
  • Scheme
    (define (A277891 n) (let ((org_k (- (A000290 (+ 1 n)) 1))) (let loop ((k org_k) (s 0)) (if (and (< k org_k) (= 1 (A010052 (+ 1 k)))) s (loop (- k (A002828 k)) (+ s (A000035 k)))))))

Formula

a(n) + A277890(n) = A260734(n).
a(n) >= A277487(n).

A278497 a(n) = Least number with the prime signature of A276573(n).

Original entry on oeis.org

2, 6, 8, 2, 6, 16, 12, 6, 24, 8, 30, 32, 6, 6, 24, 2, 12, 48, 6, 2, 24, 2, 12, 64, 2, 30, 72, 12, 30, 48, 2, 6, 24, 60, 6, 96, 12, 30, 30, 72, 48, 6, 12, 120, 6, 60, 128, 2, 6, 24, 2, 6, 144, 12, 2, 24, 6, 6, 96, 48, 30, 120, 12, 2, 48, 2, 6, 30, 24, 192, 30, 60, 72, 6, 12, 210, 6, 216, 6, 6, 96, 2, 30, 2, 12, 240, 32, 12, 24, 2, 30, 256, 6, 12, 120, 6, 120
Offset: 1

Views

Author

Antti Karttunen, Nov 25 2016

Keywords

Crossrefs

Cf. A277014 (gives the indices of squares).
Cf. also A278232.

Programs

Formula

a(n) = A046523(A276573(n)).
For all n >= 1, a(A260733(1+n)) = A278160(n).
Showing 1-10 of 11 results. Next