12345678910111213141516171819202122 |
- #!/usr/bin/ruby
- # Largest prime factor of the n-th Pell number, A000129(n).
- # https://oeis.org/A264137
- # First several terms of the sequence:
- # 2, 5, 3, 29, 7, 13, 17, 197, 41, 5741, 11, 33461, 239, 269, 577, 8297, 199, 179057, 59, 45697, 5741, 982789, 1153, 29201, 33461, 146449, 337, 44560482149, 269, 3272609, 665857, 52734529, 15607, 1800193921, 199, 1101341, 9369319, 4605197, 5521, 1746860020068409
- include("../../../factordb/auto.sf")
- func a(n) {
- lucasU(2, -1, n)
- }
- var bfile = File("bfile.txt").open_w.autoflush(true)
- for n in (2..10000) {
- var row = "#{n} #{gpf(a(n))||1}"
- say row
- bfile.say(row)
- }
|