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.

A350037 a(n) = n^2 mod round(sqrt(n)).

This page as a plain text file.
%I A350037 #43 Oct 03 2023 10:55:58
%S A350037 0,0,1,0,1,0,1,1,0,1,1,0,1,0,1,0,1,0,1,0,1,4,4,1,0,1,4,4,1,0,1,4,3,4,
%T A350037 1,0,1,4,3,4,1,0,1,4,2,2,4,1,0,1,4,2,2,4,1,0,1,4,1,0,1,4,1,0,1,4,1,0,
%U A350037 1,4,1,0,1,4,0,7,7,0,4,1,0,1,4,0,7,7,0,4
%N A350037 a(n) = n^2 mod round(sqrt(n)).
%H A350037 Winston de Greef, <a href="/A350037/b350037.txt">Table of n, a(n) for n = 1..10000</a>
%F A350037 a(n) = A000290(n) mod A000194(n). - _Michel Marcus_, Dec 14 2021
%e A350037 a(5) = 5^2 mod round(sqrt(5)) = 25 mod 2 = 1.
%t A350037 a[n_] := Mod[n^2, Round @ Sqrt[n]]; Array[a, 100, 2] (* _Amiram Eldar_, Dec 10 2021 *)
%t A350037 Table[PowerMod[n,2,Round[Sqrt[n]]],{n,2,101}] (* _Stefano Spezia_, Dec 15 2021 *)
%o A350037 (Java)
%o A350037 import java.util.Arrays;
%o A350037 public class modulus_sequence {
%o A350037   static int[] solutions = new int[480];
%o A350037   static int a_of_n (double n) {
%o A350037     int z = (int)Math.round(Math.sqrt(n));
%o A350037     int w = (int)(Math.pow(n, 2));
%o A350037     int k = w%z;
%o A350037     return k;
%o A350037   }
%o A350037   public static void main(String[] args) {
%o A350037     for (double j = 2; j < 482; j++) {
%o A350037       int h = a_of_n(j);
%o A350037       solutions[(int) (j-2)]=h;
%o A350037     }
%o A350037     System.out.println(Arrays.toString(solutions));
%o A350037   }
%o A350037 }
%o A350037 (PARI) a(n) = n^2 % round(sqrt(n)); \\ _Michel Marcus_, Dec 14 2021
%o A350037 (PARI) a(n) = lift(Mod(n, ((sqrtint(4*n) + 1)\2))^2); \\ _Michel Marcus_, Dec 14 2021
%o A350037 (Python)
%o A350037 from math import isqrt
%o A350037 def A350037(n): return pow(n,2,(m:=isqrt(n))+int(4*n>=(2*m+1)**2)) # _Chai Wah Wu_, Jan 10 2022
%Y A350037 Cf. A336302 (with ceiling instead of round).
%K A350037 nonn,easy
%O A350037 1,22
%A A350037 _Sebastian F. Orellana_, Dec 09 2021