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.

A316347 a(n) = n^2 mod(10^m), where m is the number of digits in n (written in base 10).

This page as a plain text file.
%I A316347 #34 Jan 08 2025 18:31:58
%S A316347 0,1,4,9,6,5,6,9,4,1,0,21,44,69,96,25,56,89,24,61,0,41,84,29,76,25,76,
%T A316347 29,84,41,0,61,24,89,56,25,96,69,44,21,0,81,64,49,36,25,16,9,4,1,0,1,
%U A316347 4,9,16,25,36,49,64,81,0,21,44,69,96,25,56,89,24,61,0,41,84,29
%N A316347 a(n) = n^2 mod(10^m), where m is the number of digits in n (written in base 10).
%C A316347 The set of the terms is the same as that of A238712.
%H A316347 Georg Fischer, <a href="/A316347/b316347.txt">Table of n, a(n) for n = 0..10000</a>, Jan 16 2019 (terms a(0..719585) initially submitted by Christopher D Chamness).
%e A316347 n = 13 has 2 digits in base 10, thus a(13) = 169 mod 100 = 69.
%o A316347 (Python)
%o A316347 i=0
%o A316347 while True:
%o A316347      m=i
%o A316347      j=i**2
%o A316347      l=0
%o A316347      while True:
%o A316347           m=m//10
%o A316347           l+=1
%o A316347           if m==0:
%o A316347                break
%o A316347      mod_num = 10**l
%o A316347      print(j%mod_num)
%o A316347      i+=1
%o A316347 (PARI) a(n) = n^2 % 10 ^ #digits(n) \\ _David A. Corneth_, Jun 30 2018
%o A316347 (Perl) my $mod = 10;
%o A316347 foreach my $i(0..10000) {
%o A316347      print "$i " . (($i * $i) % $mod) . "\n";
%o A316347      if (length($i + 1) > length($i)) { $mod *= 10; }
%o A316347 } # _Georg Fischer_, Jan 16 2019
%Y A316347 Cf. A238712.
%K A316347 nonn,base,look,easy
%O A316347 0,3
%A A316347 _Christopher D Chamness_, Jun 29 2018