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.

A180313 A sequence a(n) such that a(n+1)^2 - a(n)^2 are perfect squares.

Original entry on oeis.org

3, 5, 13, 85, 221, 1445, 3757, 24565, 63869, 417605, 1085773, 7099285, 18458141, 120687845, 313788397, 2051693365, 5334402749, 34878787205, 90684846733, 592939382485, 1541642394461, 10079969502245, 26207920705837, 171359481538165, 445534651999229, 2913111186148805
Offset: 1

Views

Author

Valentin Tiriac (valtron2000(AT)gmail.com), Aug 26 2010

Keywords

Comments

The lexically smallest sequence with a(n+1)^2-a(n)^2 representing perfect squares is A018928.
This version here is constructed via a(n+1) = a(n)* sqrt( 1+((p^2-1)/(2p))^2) where p = A020639(a(n)) is the smallest prime divisor of the previous term.

Examples

			After a(1)=3, p=3 (again) and a(2) = 3*sqrt(1+ (8/6)^2) = 5.
After a(4)=85, p=5 and a(5) = 85*sqrt(1+ (24/10)^2) = 85*sqrt(169/25) = 221.
		

Programs

  • Maple
    A020639 := proc(n) min(op(numtheory[factorset](n))) ; end proc:
    A180313 := proc(n) option remember; if n = 1 then 3; else aprev := procname(n-1) ; p := A020639(aprev) ; aprev* sqrt(1+((p^2-1)/2/p)^2) ; end if; end proc:
    for n from 1 to 30 do printf("%d,",A180313(n)) ; end do: # R. J. Mathar, Sep 23 2010
  • Mathematica
    spd[n_] := FactorInteger[n][[1, 1]];
    a[n_] := a[n] = If[n == 1, 3, aprev = a[n-1];
        p = spd[aprev]; aprev*Sqrt[1+((p^2-1)/2/p)^2]];
    Table[a[n], {n, 1, 26}] (* Jean-François Alcover, Feb 28 2024, after R. J. Mathar *)
  • Perl
    # use 5.12.0; use warnings; use Math::Prime::TiedArray; tie my @primes, 'Math::Prime::TiedArray';
    sub SmallestPrimeDivisor ($) { my ($n) = @_; for my $p (@primes) { if ($n % $p == 0) { return $p; } } }
    sub FindIncrement ($) { my ($n) = @_; my $p = SmallestPrimeDivisor $n; my $k = $n / $p; return $k * ($p ** 2 - 1) / 2; }
    my $n = 3; say $n; for my $i (0 .. 23) { my $d = FindIncrement $n; $n = sqrt($d ** 2 + $n ** 2); say $n; }

Extensions

Nomenclature normalized by R. J. Mathar, Sep 23 2010
Corrected indexing error introduced with previous edit - R. J. Mathar, Oct 01 2010