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.

A160504 a(n) = number of ordered pairs (i,j) such that a(i)+a(j)

Original entry on oeis.org

1, 1, 1, 3, 6, 6, 6, 15, 15, 18, 18, 18, 21, 21, 21, 21, 27, 27, 29, 38, 38, 47, 59, 59, 72, 72, 72, 84, 90, 90, 96, 96, 97, 109, 109, 112, 123, 123, 123, 141, 141, 143, 153, 153, 161, 167, 167, 170, 181, 181, 186, 186, 186, 193, 194, 194, 202, 202, 202, 210, 216, 216
Offset: 1

Views

Author

Masahiko Shin, May 16 2009

Keywords

Comments

It appears that the longest run of identical values in the sequence has length five, occurring twice: a(69) = ... = a(73) = 239 and a(81) = ... = a(85) = 282. Length four appears once at a(13) = ... = a(16) = 21. The last adjacent pair with equal values appears to be a(340) = a(341) = 2558; checked through n=1000. - Hartmut F. W. Hoft, Jun 04 2017

Examples

			a(3) = 1 because there is only one possible pair of previous terms, {1, 1}, and its sum is 2, which is less than 3.
a(4) = 3 because there are three possible pairs of previous terms {a(1), a(2)}, {a(1), a(3)}, {a(2), a(3)}, which are here considered distinct even though they all work out to {1, 1} with a sum of 2, which is less than 4.
a(5) = 6 because there are six possible pairs of previous terms: {a(1), a(2)}, {a(1), a(3)}, {a(1), 3}, {a(2), a(3)}, {a(2), 3}, {a(3), 3}, with sums 2, 2, 4, 2, 4, 4, respectively, all of which are less than 6.
		

Programs

  • Mathematica
    count[cL_] := Module[{n=Length[cL]+1, c=0, i, j}, Do[If[cL[[i]]+cL[[j]]Hartmut F. W. Hoft, Jun 04 2017 *)

Extensions

There were non-ASCII characters in the definition, which I hope I have interpreted correctly! - N. J. A. Sloane, Jul 23 2009
Definition corrected by Sean A. Irvine, Apr 08 2010
Corrected and extended by Sean A. Irvine, Apr 08 2010